diff options
| author | Rapptz <[email protected]> | 2019-12-20 23:10:46 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-09-23 03:21:15 -0400 |
| commit | a6381dcf77f773316ea59767a06d06cfcc57e4d9 (patch) | |
| tree | 91e3606099ec7329518f5e9648a784bc3da83e73 /discord/state.py | |
| parent | Properly handle disconnects in voice when force disconnected (diff) | |
| download | discord.py-a6381dcf77f773316ea59767a06d06cfcc57e4d9.tar.xz discord.py-a6381dcf77f773316ea59767a06d06cfcc57e4d9.zip | |
Add support for guild intents
Diffstat (limited to 'discord/state.py')
| -rw-r--r-- | discord/state.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/discord/state.py b/discord/state.py index fc297d03..6c0f1e89 100644 --- a/discord/state.py +++ b/discord/state.py @@ -51,6 +51,7 @@ from .member import Member from .role import Role from .enums import ChannelType, try_enum, Status, Enum from . import utils +from .flags import Intents from .embeds import Embed from .object import Object from .invite import Invite @@ -115,8 +116,15 @@ class ConnectionState: else: status = str(status) + intents = options.get('intents', None) + if intents is not None: + if not isinstance(intents, Intents): + raise TypeError('intents parameter must be Intent not %r' % type(intents)) + intents = intents.value + self._activity = activity self._status = status + self._intents = intents self.parsers = parsers = {} for attr, func in inspect.getmembers(self): |