Intents¶
Intents allow you to conditionally subscribe to pre-defined “intents”, groups of events defined by Discord. If you do not specify a certain intent, you will not receive any of the gateway events that are batched into that group. Here is a list of intents and the discord intents they control.
- class cordy.models.intents.Intents(**kwargs: dict[str, bool])[source]¶
-
- classmethod all() cordy.models.intents.Intents [source]¶
Create an Intents object with all instents enabled.
- Returns
The Intents object
- Return type
- classmethod privileged() cordy.models.intents.Intents [source]¶
Create an Intents object with only
GUILD_PRESENCES
&GUILD_MEMBERS
intents enabled.- Returns
The Intents object
- Return type
- classmethod default() cordy.models.intents.Intents [source]¶
Create an Intents object with all intents except privileged enabled.
- Returns
The Intents object
- Return type
- classmethod none() cordy.models.intents.Intents [source]¶
Create an Intents object with no intents enabled.
- Returns
The Intents object
- Return type
Example¶
Example for enabling all intents¶
cordy.Client(intents = cordy.Intents.all())
Example of intents usage with client¶
intents = cordy.Intents.default()
intents.members = True
intents.typing = False
intents.dm_reactions = False
cordy.Client(intents = intents)