summary refs log tree commit diff
path: root/util/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--util/src/entities/Channel.ts5
-rw-r--r--util/src/util/Permissions.ts43
2 files changed, 15 insertions, 33 deletions
diff --git a/util/src/entities/Channel.ts b/util/src/entities/Channel.ts

index 0be1c5ec..fce85e3f 100644 --- a/util/src/entities/Channel.ts +++ b/util/src/entities/Channel.ts
@@ -16,6 +16,11 @@ 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 + // TODO: what are channel types between 7-9? + 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..628a495d 100644 --- a/util/src/util/Permissions.ts +++ b/util/src/util/Permissions.ts
@@ -15,40 +15,9 @@ try { export type PermissionResolvable = bigint | number | Permissions | PermissionResolvable[] | PermissionString; -type PermissionString = - | "CREATE_INSTANT_INVITE" - | "KICK_MEMBERS" - | "BAN_MEMBERS" - | "ADMINISTRATOR" - | "MANAGE_CHANNELS" - | "MANAGE_GUILD" - | "ADD_REACTIONS" - | "VIEW_AUDIT_LOG" - | "PRIORITY_SPEAKER" - | "STREAM" - | "VIEW_CHANNEL" - | "SEND_MESSAGES" - | "SEND_TTS_MESSAGES" - | "MANAGE_MESSAGES" - | "EMBED_LINKS" - | "ATTACH_FILES" - | "READ_MESSAGE_HISTORY" - | "MENTION_EVERYONE" - | "USE_EXTERNAL_EMOJIS" - | "VIEW_GUILD_INSIGHTS" - | "CONNECT" - | "SPEAK" - | "MUTE_MEMBERS" - | "DEAFEN_MEMBERS" - | "MOVE_MEMBERS" - | "USE_VAD" - | "CHANGE_NICKNAME" - | "MANAGE_NICKNAMES" - | "MANAGE_ROLES" - | "MANAGE_WEBHOOKS" - | "MANAGE_EMOJIS_AND_STICKERS"; +type PermissionString = keyof typeof Permissions.FLAGS; -const CUSTOM_PERMISSION_OFFSET = BigInt(1) << BigInt(48); // 16 free custom permission bits, and 16 for discord to add new ones +const CUSTOM_PERMISSION_OFFSET = BigInt(1) << BigInt(48); // 16 free custom permission bits, and 11 for discord to add new ones export class Permissions extends BitField { cache: PermissionCache = {}; @@ -85,6 +54,14 @@ 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), + // TODO: what is permission 33? + 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