summary refs log tree commit diff
path: root/util
diff options
context:
space:
mode:
authorAlTech98 <altech123159@gmail.com>2021-09-04 11:43:09 +0200
committerAlTech98 <altech123159@gmail.com>2021-09-04 11:43:09 +0200
commitaafdc5d0eeab36d04d0a0463a2c7d10727954f88 (patch)
tree0d161d6abcc7b326c9c02fbd19b149b2a67879e9 /util
parentVOICE_SERVER_UPDATE now has the endpoint of the guild's region (diff)
downloadserver-aafdc5d0eeab36d04d0a0463a2c7d10727954f88.tar.xz
Added missing permissions and channel types
Diffstat (limited to 'util')
-rw-r--r--util/src/entities/Channel.ts4
-rw-r--r--util/src/util/Permissions.ts15
2 files changed, 18 insertions, 1 deletions
diff --git a/util/src/entities/Channel.ts b/util/src/entities/Channel.ts
index 0be1c5ec..486b5c44 100644
--- a/util/src/entities/Channel.ts
+++ b/util/src/entities/Channel.ts
@@ -16,6 +16,10 @@ export enum ChannelType {
 	GUILD_CATEGORY = 4, // an organizational category that contains up to 50 channels
 	GUILD_NEWS = 5, // a channel that users can follow and crosspost into their own server
 	GUILD_STORE = 6, // a channel in which game developers can sell their game on Discord
+	GUILD_NEWS_THREAD = 10, // a temporary sub-channel within a GUILD_NEWS channel
+	GUILD_PUBLIC_THREAD = 11, // a temporary sub-channel within a GUILD_TEXT channel
+	GUILD_PRIVATE_THREAD = 12, // a temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission
+	GUILD_STAGE_VOICE = 13, // a voice channel for hosting events with an audience
 }
 
 @Entity("channels")
diff --git a/util/src/util/Permissions.ts b/util/src/util/Permissions.ts
index ab8dd9b1..9cac0226 100644
--- a/util/src/util/Permissions.ts
+++ b/util/src/util/Permissions.ts
@@ -46,7 +46,13 @@ type PermissionString =
 	| "MANAGE_NICKNAMES"
 	| "MANAGE_ROLES"
 	| "MANAGE_WEBHOOKS"
-	| "MANAGE_EMOJIS_AND_STICKERS";
+	| "MANAGE_EMOJIS_AND_STICKERS"
+	| "USE_APPLICATION_COMMANDS"
+	| "REQUEST_TO_SPEAK"
+	| "MANAGE_THREADS"
+	| "USE_PUBLIC_THREADS"
+	| "USE_PRIVATE_THREADS"
+	| "USE_EXTERNAL_STICKERS";
 
 const CUSTOM_PERMISSION_OFFSET = BigInt(1) << BigInt(48); // 16 free custom permission bits, and 16 for discord to add new ones
 
@@ -85,6 +91,13 @@ export class Permissions extends BitField {
 		MANAGE_ROLES: BigInt(1) << BigInt(28),
 		MANAGE_WEBHOOKS: BigInt(1) << BigInt(29),
 		MANAGE_EMOJIS_AND_STICKERS: BigInt(1) << BigInt(30),
+		USE_APPLICATION_COMMANDS: BigInt(1) << BigInt(31),
+		REQUEST_TO_SPEAK: BigInt(1) << BigInt(32),
+		MANAGE_THREADS: BigInt(1) << BigInt(34),
+		USE_PUBLIC_THREADS: BigInt(1) << BigInt(35),
+		USE_PRIVATE_THREADS: BigInt(1) << BigInt(36),
+		USE_EXTERNAL_STICKERS: BigInt(1) << BigInt(37),
+
 		/**
 		 * CUSTOM PERMISSIONS ideas:
 		 * - allow user to dm members