diff options
| author | Rapptz <[email protected]> | 2021-03-28 11:07:51 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-04-06 01:11:36 -0400 |
| commit | 8cece19b2220bd6b7f61438219a0b88d0768a079 (patch) | |
| tree | d82c331964790add2a4f11f7fc0342074a2f4521 /discord/state.py | |
| parent | Add support for setting application_id (diff) | |
| download | discord.py-8cece19b2220bd6b7f61438219a0b88d0768a079.tar.xz discord.py-8cece19b2220bd6b7f61438219a0b88d0768a079.zip | |
Add on_interaction event and Interaction class.
This is the first pass at the functionality. It's currently a bit
incomplete.
Diffstat (limited to 'discord/state.py')
| -rw-r--r-- | discord/state.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/state.py b/discord/state.py index 2aa12d68..82f5371c 100644 --- a/discord/state.py +++ b/discord/state.py @@ -51,6 +51,7 @@ from . import utils from .flags import Intents, MemberCacheFlags from .object import Object from .invite import Invite +from .interactions import Interaction class ChunkRequest: def __init__(self, guild_id, loop, resolver, *, cache=True): @@ -586,6 +587,10 @@ class ConnectionState: if reaction: self.dispatch('reaction_clear_emoji', reaction) + def parse_interaction_create(self, data): + interaction = Interaction(data=data, state=self) + self.dispatch('interaction', interaction) + def parse_presence_update(self, data): guild_id = utils._get_as_snowflake(data, 'guild_id') guild = self._get_guild(guild_id) |