-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
permissions.ts
81 lines (77 loc) · 2.2 KB
/
permissions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
* Types extracted from https://discord.com/developers/docs/topics/permissions
*/
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* These flags are exported as `BigInt`s and NOT numbers. For most of them, you can
* convert them in a number by wrapping it in `Number()`, however be careful as any
* further bits added may cause issues if done so. Try to use BigInts as much as possible
* or modules that can replicate them in some way.
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export const PermissionFlagsBits = {
CREATE_INSTANT_INVITE: 1n,
KICK_MEMBERS: 2n,
BAN_MEMBERS: 4n,
ADMINISTRATOR: 8n,
MANAGE_CHANNELS: 16n,
MANAGE_GUILD: 32n,
ADD_REACTIONS: 64n,
VIEW_AUDIT_LOG: 128n,
PRIORITY_SPEAKER: 256n,
STREAM: 512n,
VIEW_CHANNEL: 1024n,
SEND_MESSAGES: 2048n,
SEND_TTS_MESSAGES: 4096n,
MANAGE_MESSAGES: 8192n,
EMBED_LINKS: 16384n,
ATTACH_FILES: 32768n,
READ_MESSAGE_HISTORY: 65536n,
MENTION_EVERYONE: 131072n,
USE_EXTERNAL_EMOJIS: 262144n,
VIEW_GUILD_INSIGHTS: 524288n,
CONNECT: 1048576n,
SPEAK: 2097152n,
MUTE_MEMBERS: 4194304n,
DEAFEN_MEMBERS: 8388608n,
MOVE_MEMBERS: 16777216n,
USE_VAD: 33554432n,
CHANGE_NICKNAME: 67108864n,
MANAGE_NICKNAMES: 134217728n,
MANAGE_ROLES: 268435456n,
MANAGE_WEBHOOKS: 536870912n,
MANAGE_EMOJIS: 1073741824n,
} as const;
/**
* Freeze the object of bits, preventing any modifications to it.
* @internal
*/
Object.freeze(PermissionFlagsBits);
/**
* https://discord.com/developers/docs/topics/permissions#role-object
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIRole {
id: string;
name: string;
color: number;
hoist: boolean;
position: number;
/**
* @deprecated Use `permissions_new` instead
*/
permissions: number;
permissions_new: string;
managed: boolean;
mentionable: boolean;
tags?: APIRoleTags;
}
/**
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export interface APIRoleTags {
bot_id?: string;
premium_subscriber?: null;
integration_id?: string;
}