aboutsummaryrefslogtreecommitdiff
path: root/src/webpack/common
diff options
context:
space:
mode:
authorNuckyz <61953774+Nuckyz@users.noreply.github.com>2023-05-14 21:33:04 -0300
committerGitHub <noreply@github.com>2023-05-15 02:33:04 +0200
commit64b38348d43040aba9823003b28acbb906e8a7d7 (patch)
tree0b9a0cce4782a4bfeb474ef716b6050dc47c4fcf /src/webpack/common
parent9c1b3a9afd515ea7c38d9c4b4302a60b8d9858ff (diff)
downloadVencord-64b38348d43040aba9823003b28acbb906e8a7d7.tar.gz
Vencord-64b38348d43040aba9823003b28acbb906e8a7d7.tar.bz2
Vencord-64b38348d43040aba9823003b28acbb906e8a7d7.zip
feat(plugins): Permissions Viewer (#477)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src/webpack/common')
-rw-r--r--src/webpack/common/types/utils.d.ts45
-rw-r--r--src/webpack/common/utils.ts2
2 files changed, 47 insertions, 0 deletions
diff --git a/src/webpack/common/types/utils.d.ts b/src/webpack/common/types/utils.d.ts
index 1534f32..51b3cee 100644
--- a/src/webpack/common/types/utils.d.ts
+++ b/src/webpack/common/types/utils.d.ts
@@ -85,6 +85,51 @@ export type RestAPI = Record<"delete" | "get" | "patch" | "post" | "put", (data:
getAPIBaseURL(withVersion?: boolean): string;
};
+export type Permissions = "CREATE_INSTANT_INVITE"
+ | "KICK_MEMBERS"
+ | "BAN_MEMBERS"
+ | "ADMINISTRATOR"
+ | "MANAGE_CHANNELS"
+ | "MANAGE_GUILD"
+ | "CHANGE_NICKNAME"
+ | "MANAGE_NICKNAMES"
+ | "MANAGE_ROLES"
+ | "MANAGE_WEBHOOKS"
+ | "MANAGE_GUILD_EXPRESSIONS"
+ | "VIEW_AUDIT_LOG"
+ | "VIEW_CHANNEL"
+ | "VIEW_GUILD_ANALYTICS"
+ | "VIEW_CREATOR_MONETIZATION_ANALYTICS"
+ | "MODERATE_MEMBERS"
+ | "SEND_MESSAGES"
+ | "SEND_TTS_MESSAGES"
+ | "MANAGE_MESSAGES"
+ | "EMBED_LINKS"
+ | "ATTACH_FILES"
+ | "READ_MESSAGE_HISTORY"
+ | "MENTION_EVERYONE"
+ | "USE_EXTERNAL_EMOJIS"
+ | "ADD_REACTIONS"
+ | "USE_APPLICATION_COMMANDS"
+ | "MANAGE_THREADS"
+ | "CREATE_PUBLIC_THREADS"
+ | "CREATE_PRIVATE_THREADS"
+ | "USE_EXTERNAL_STICKERS"
+ | "SEND_MESSAGES_IN_THREADS"
+ | "CONNECT"
+ | "SPEAK"
+ | "MUTE_MEMBERS"
+ | "DEAFEN_MEMBERS"
+ | "MOVE_MEMBERS"
+ | "USE_VAD"
+ | "PRIORITY_SPEAKER"
+ | "STREAM"
+ | "USE_EMBEDDED_ACTIVITIES"
+ | "REQUEST_TO_SPEAK"
+ | "MANAGE_EVENTS";
+
+export type PermissionsBits = Record<Permissions, bigint>;
+
export interface Locale {
name: string;
value: string;
diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts
index 3893a3a..629d052 100644
--- a/src/webpack/common/utils.ts
+++ b/src/webpack/common/utils.ts
@@ -114,3 +114,5 @@ waitFor("parseTopic", m => Parser = m);
export let SettingsRouter: any;
waitFor(["open", "saveAccountChanges"], m => SettingsRouter = m);
+
+export const PermissionsBits: t.PermissionsBits = findLazy(m => typeof m.ADMINISTRATOR === "bigint");