diff options
| author | Rapptz <[email protected]> | 2020-01-17 19:48:46 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-01-17 19:53:28 -0500 |
| commit | 87f9dcff9c5af9c4fa6e6b148663320522a3c82f (patch) | |
| tree | 2a46dc76aafa9e10ad134c681705684bdb4cf29c /discord/raw_models.py | |
| parent | Add support for on_invite_create and on_invite_delete (diff) | |
| download | discord.py-87f9dcff9c5af9c4fa6e6b148663320522a3c82f.tar.xz discord.py-87f9dcff9c5af9c4fa6e6b148663320522a3c82f.zip | |
Add support for clearing a specific reaction.
Closes #2440
Diffstat (limited to 'discord/raw_models.py')
| -rw-r--r-- | discord/raw_models.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/discord/raw_models.py b/discord/raw_models.py index 1f318564..dc094e34 100644 --- a/discord/raw_models.py +++ b/discord/raw_models.py @@ -177,3 +177,32 @@ class RawReactionClearEvent(_RawReprMixin): self.guild_id = int(data['guild_id']) except KeyError: self.guild_id = None + +class RawReactionClearEmojiEvent(_RawReprMixin): + """Represents the payload for a :func:`on_raw_reaction_clear_emoji` event. + + .. versionadded:: 1.3.0 + + Attributes + ----------- + message_id: :class:`int` + The message ID that got its reactions cleared. + channel_id: :class:`int` + The channel ID where the reactions got cleared. + guild_id: Optional[:class:`int`] + The guild ID where the reactions got cleared. + emoji: :class:`PartialEmoji` + The custom or unicode emoji being removed. + """ + + __slots__ = ('message_id', 'channel_id', 'guild_id', 'emoji') + + def __init__(self, data, emoji): + self.emoji = emoji + self.message_id = int(data['message_id']) + self.channel_id = int(data['channel_id']) + + try: + self.guild_id = int(data['guild_id']) + except KeyError: + self.guild_id = None |