From 28e5b2a5e133970aff7d0f4db1d973c7516e429a Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 26 Sep 2020 06:23:24 -0400 Subject: [PATCH] Add Client.intents to query the current intents Closes #5854 --- discord/client.py | 8 ++++++++ discord/state.py | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/discord/client.py b/discord/client.py index fb2557195..1ddb09d6b 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 507226cc2..aec723d4f 100644 --- a/discord/state.py +++ b/discord/state.py @@ -231,6 +231,12 @@ class ConnectionState: u = self.user 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())