summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-21 21:39:48 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-21 21:39:48 +0200
commit952a05601472b116007b1ee0f4e53048cdea9e28 (patch)
tree90a9bf6f6380f3da744ce7662caab18a8ae3106b
parent1.2.0 (diff)
downloadserver-952a05601472b116007b1ee0f4e53048cdea9e28.tar.xz
fix channel permission calc
-rw-r--r--src/util/Permissions.ts2
-rw-r--r--src/util/Snowflake.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/util/Permissions.ts b/src/util/Permissions.ts
index 4627143a..e9dd6f4d 100644
--- a/src/util/Permissions.ts
+++ b/src/util/Permissions.ts
@@ -128,7 +128,7 @@ export class Permissions extends BitField {
 			// ~ operator inverts deny (e.g. 011 -> 100)
 			// & operator only allows 1 for both ~deny and permission (e.g. 010 & 100 -> 000)
 			// | operators adds both together (e.g. 000 + 100 -> 100)
-		}, 0n ?? init);
+		}, init || 0n);
 	}
 
 	static rolePermission(roles: Role[]) {
diff --git a/src/util/Snowflake.ts b/src/util/Snowflake.ts
index 1ccae43c..add940f8 100644
--- a/src/util/Snowflake.ts
+++ b/src/util/Snowflake.ts
@@ -109,7 +109,7 @@ export class Snowflake {
 	static deconstruct(snowflake) {
 		const BINARY = Snowflake.idToBinary(snowflake).toString(2).padStart(64, "0");
 		const res = {
-			timestamp: parseInt(BINARY.substring(0, 42), 2) + EPOCH,
+			timestamp: parseInt(BINARY.substring(0, 42), 2) + Snowflake.EPOCH,
 			workerID: parseInt(BINARY.substring(42, 47), 2),
 			processID: parseInt(BINARY.substring(47, 52), 2),
 			increment: parseInt(BINARY.substring(52, 64), 2),