Total Complexity | 1 |
Total Lines | 78 |
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 IntFlag |
||
7 | |||
8 | |||
9 | class Intents(IntFlag): |
||
10 | """Discord client intents. |
||
11 | |||
12 | These give your client more permissions. |
||
13 | |||
14 | .. note:: |
||
15 | The given Intents must also be enabled for your client on |
||
16 | the discord dashboard. |
||
17 | |||
18 | Attributes |
||
19 | ---------- |
||
20 | NONE: |
||
21 | No intents. |
||
22 | GUILDS: |
||
23 | Guilds intent. |
||
24 | GUILD_MEMBERS: |
||
25 | Members intent. |
||
26 | GUILD_BANS: |
||
27 | Bans intent. |
||
28 | GUILD_EMOJIS_AND_STICKERS: |
||
29 | Emoji and Sticker intent. |
||
30 | GUILD_INTEGRATIONS: |
||
31 | Integrations intent. |
||
32 | GUILD_WEBHOOKS: |
||
33 | Webhooks intent. |
||
34 | GUILD_INVITES: |
||
35 | Invites intent. |
||
36 | GUILD_VOICE_STATES: |
||
37 | Voice states intent. |
||
38 | GUILD_PRESENCES: |
||
39 | Presences intent. |
||
40 | GUILD_MESSAGES: |
||
41 | Message intent. |
||
42 | GUILD_MESSAGE_REACTIONS: |
||
43 | Reactions to messages intent. |
||
44 | GUILD_MESSAGE_TYPING: |
||
45 | Typing to message intent. |
||
46 | DIRECT_MESSAGES: |
||
47 | DM messages intent. |
||
48 | DIRECT_MESSAGE_REACTIONS: |
||
49 | DM reaction to messages intent. |
||
50 | DIRECT_MESSAGE_TYPING: |
||
51 | DM typing to message intent. |
||
52 | """ |
||
53 | |||
54 | NONE = 0 |
||
55 | GUILDS = 1 << 0 |
||
56 | GUILD_MEMBERS = 1 << 1 |
||
57 | GUILD_BANS = 1 << 2 |
||
58 | GUILD_EMOJIS_AND_STICKERS = 1 << 3 |
||
59 | GUILD_INTEGRATIONS = 1 << 4 |
||
60 | GUILD_WEBHOOKS = 1 << 5 |
||
61 | GUILD_INVITES = 1 << 6 |
||
62 | GUILD_VOICE_STATES = 1 << 7 |
||
63 | GUILD_PRESENCES = 1 << 8 |
||
64 | GUILD_MESSAGES = 1 << 9 |
||
65 | GUILD_MESSAGE_REACTIONS = 1 << 10 |
||
66 | GUILD_MESSAGE_TYPING = 1 << 11 |
||
67 | DIRECT_MESSAGES = 1 << 12 |
||
68 | DIRECT_MESSAGE_REACTIONS = 1 << 13 |
||
69 | DIRECT_MESSAGE_TYPING = 1 << 14 |
||
70 | |||
71 | @classmethod |
||
72 | def all(cls) -> Intents: |
||
73 | """ |
||
74 | :class:`~pincer.objects.app.intents.Intents`: |
||
75 | Method of all intents |
||
76 | """ |
||
77 | return cls(sum(cls)) |
||
78 |