summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--api/src/routes/channels/#channel_id/messages/index.ts4
-rw-r--r--util/src/entities/Channel.ts4
-rw-r--r--util/src/util/Permissions.ts15
3 files changed, 22 insertions, 1 deletions
diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts
index 1a3150cf..ad590d05 100644
--- a/api/src/routes/channels/#channel_id/messages/index.ts
+++ b/api/src/routes/channels/#channel_id/messages/index.ts
@@ -17,11 +17,15 @@ export function isTextChannel(type: ChannelType): boolean {
 	switch (type) {
 		case ChannelType.GUILD_STORE:
 		case ChannelType.GUILD_VOICE:
+		case ChannelType.GUILD_STAGE_VOICE:
 		case ChannelType.GUILD_CATEGORY:
 			throw new HTTPError("not a text channel", 400);
 		case ChannelType.DM:
 		case ChannelType.GROUP_DM:
 		case ChannelType.GUILD_NEWS:
+		case ChannelType.GUILD_NEWS_THREAD:
+		case ChannelType.GUILD_PUBLIC_THREAD:
+		case ChannelType.GUILD_PRIVATE_THREAD:
 		case ChannelType.GUILD_TEXT:
 			return true;
 	}
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