Total Complexity | 3 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # Copyright Pincer 2021-Present |
||
|
|||
2 | # Full MIT License can be found in `LICENSE` at the project root. |
||
3 | |||
4 | from __future__ import annotations |
||
5 | |||
6 | from enum import IntEnum |
||
7 | |||
8 | |||
9 | class Intents(IntEnum): |
||
10 | """ |
||
11 | Discord client intents. |
||
12 | |||
13 | These give your client more permissions. |
||
14 | |||
15 | NOTE: The given Intents must also be enabled for your client on |
||
16 | the discord dashboard. |
||
17 | """ |
||
18 | NONE = 0 |
||
19 | GUILDS = 1 << 0 |
||
20 | GUILD_MEMBERS = 1 << 1 |
||
21 | GUILD_BANS = 1 << 2 |
||
22 | GUILD_EMOJIS_AND_STICKERS = 1 << 3 |
||
23 | GUILD_INTEGRATIONS = 1 << 4 |
||
24 | GUILD_WEBHOOKS = 1 << 5 |
||
25 | GUILD_INVITES = 1 << 6 |
||
26 | GUILD_VOICE_STATES = 1 << 7 |
||
27 | GUILD_PRESENCES = 1 << 8 |
||
28 | GUILD_MESSAGES = 1 << 9 |
||
29 | GUILD_MESSAGE_REACTIONS = 1 << 10 |
||
30 | GUILD_MESSAGE_TYPING = 1 << 11 |
||
31 | DIRECT_MESSAGES = 1 << 12 |
||
32 | DIRECT_MESSAGE_REACTIONS = 1 << 13 |
||
33 | DIRECT_MESSAGE_TYPING = 1 << 14 |
||
34 | |||
35 | @staticmethod |
||
36 | def all(): |
||
37 | """Consists of all intents""" |
||
38 | res = 0 |
||
39 | |||
40 | for intent in list(map(lambda itm: itm.value, Intents)): |
||
41 | res |= intent |
||
42 | |||
43 | return res |
||
44 |