1
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
|
2
|
|
|
# MIT License |
3
|
|
|
# |
4
|
|
|
# Copyright (c) 2021 Pincer |
5
|
|
|
# |
6
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining |
7
|
|
|
# a copy of this software and associated documentation files |
8
|
|
|
# (the "Software"), to deal in the Software without restriction, |
9
|
|
|
# including without limitation the rights to use, copy, modify, merge, |
10
|
|
|
# publish, distribute, sublicense, and/or sell copies of the Software, |
11
|
|
|
# and to permit persons to whom the Software is furnished to do so, |
12
|
|
|
# subject to the following conditions: |
13
|
|
|
# |
14
|
|
|
# The above copyright notice and this permission notice shall be |
15
|
|
|
# included in all copies or substantial portions of the Software. |
16
|
|
|
# |
17
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
18
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
19
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
20
|
|
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
21
|
|
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
22
|
|
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
23
|
|
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
24
|
|
|
from __future__ import annotations |
25
|
|
|
|
26
|
|
|
from enum import Enum |
27
|
|
|
|
28
|
|
|
|
29
|
|
|
class Intents(Enum): |
30
|
|
|
""" |
31
|
|
|
Discord client intents. |
32
|
|
|
|
33
|
|
|
These give your client more permissions. |
34
|
|
|
|
35
|
|
|
NOTE: The given Intents must also be enabled for your client on |
36
|
|
|
the discord dashboard. |
37
|
|
|
""" |
38
|
|
|
GUILDS = 1 << 0 |
39
|
|
|
GUILD_MEMBERS = 1 << 1 |
40
|
|
|
GUILD_BANS = 1 << 2 |
41
|
|
|
GUILD_EMOJIS_AND_STICKERS = 1 << 3 |
42
|
|
|
GUILD_INTEGRATIONS = 1 << 4 |
43
|
|
|
GUILD_WEBHOOKS = 1 << 5 |
44
|
|
|
GUILD_INVITES = 1 << 6 |
45
|
|
|
GUILD_VOICE_STATES = 1 << 7 |
46
|
|
|
GUILD_PRESENCES = 1 << 8 |
47
|
|
|
GUILD_MESSAGES = 1 << 9 |
48
|
|
|
GUILD_MESSAGE_REACTIONS = 1 << 10 |
49
|
|
|
GUILD_MESSAGE_TYPING = 1 << 11 |
50
|
|
|
DIRECT_MESSAGES = 1 << 12 |
51
|
|
|
DIRECT_MESSAGE_REACTIONS = 1 << 13 |
52
|
|
|
DIRECT_MESSAGE_TYPING = 1 << 14 |
53
|
|
|
|
54
|
|
|
@staticmethod |
55
|
|
|
def all(): |
56
|
|
|
"""Consists of all intents""" |
57
|
|
|
res = 0 |
58
|
|
|
|
59
|
|
|
for intent in list(map(lambda itm: itm.value, Intents)): |
60
|
|
|
res |= intent |
61
|
|
|
|
62
|
|
|
return res |
63
|
|
|
|