diff options
| author | Rapptz <[email protected]> | 2020-09-26 06:23:24 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-09-26 06:35:41 -0400 |
| commit | 28e5b2a5e133970aff7d0f4db1d973c7516e429a (patch) | |
| tree | 19c6a64fdef16b0e8f3635f80f887136b763c53a /discord | |
| parent | Fixed incorrectly named 'Intent' class in doc. (diff) | |
| download | discord.py-28e5b2a5e133970aff7d0f4db1d973c7516e429a.tar.xz discord.py-28e5b2a5e133970aff7d0f4db1d973c7516e429a.zip | |
Add Client.intents to query the current intents
Closes #5854
Diffstat (limited to 'discord')
| -rw-r--r-- | discord/client.py | 8 | ||||
| -rw-r--r-- | discord/state.py | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py index fb255719..1ddb09d6 100644 --- a/discord/client.py +++ b/discord/client.py @@ -749,6 +749,14 @@ class Client: else: raise TypeError('allowed_mentions must be AllowedMentions not {0.__class__!r}'.format(value)) + @property + def intents(self): + """:class:`Intents`: The intents configured for this connection. + + .. versionadded:: 1.5 + """ + return self._connection.intents + # helpers/getters @property diff --git a/discord/state.py b/discord/state.py index 507226cc..aec723d4 100644 --- a/discord/state.py +++ b/discord/state.py @@ -232,6 +232,12 @@ class ConnectionState: return u.id if u else None @property + def intents(self): + ret = Intents.none() + ret.value = self._intents.value + return ret + + @property def voice_clients(self): return list(self._voice_clients.values()) |