diff options
| author | Rapptz <[email protected]> | 2019-08-11 19:11:22 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-08-11 19:11:22 -0400 |
| commit | f513d831d137d29ee4638a5e6a218f70b56c5ac5 (patch) | |
| tree | 6d9ed5e48f195f7cfef746c9d4ed18bb6f8abd16 /discord/raw_models.py | |
| parent | Add version information from missing PRs. (diff) | |
| download | discord.py-f513d831d137d29ee4638a5e6a218f70b56c5ac5.tar.xz discord.py-f513d831d137d29ee4638a5e6a218f70b56c5ac5.zip | |
Add RawReactionActionEvent.event_type attribute.
This helps differentiate between reaction removal or addition.
Diffstat (limited to 'discord/raw_models.py')
| -rw-r--r-- | discord/raw_models.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/discord/raw_models.py b/discord/raw_models.py index 26247ca3..103d148a 100644 --- a/discord/raw_models.py +++ b/discord/raw_models.py @@ -112,6 +112,9 @@ class RawReactionActionEvent(_RawReprMixin): """Represents the payload for a :func:`on_raw_reaction_add` or :func:`on_raw_reaction_remove` event. + .. versionchanged:: 1.3.0 + The ``event_type`` attribute was added. + Attributes ----------- message_id: :class:`int` @@ -124,15 +127,20 @@ class RawReactionActionEvent(_RawReprMixin): The guild ID where the reaction got added or removed, if applicable. emoji: :class:`PartialEmoji` The custom or unicode emoji being used. + event_type: :class:`str` + The event type that triggered this action. Can be + ``REACTION_ADD`` for reaction addition or + ``REACTION_REMOVE`` for reaction removal. """ __slots__ = ('message_id', 'user_id', 'channel_id', 'guild_id', 'emoji') - def __init__(self, data, emoji): + def __init__(self, data, emoji, event_type): self.message_id = int(data['message_id']) self.channel_id = int(data['channel_id']) self.user_id = int(data['user_id']) self.emoji = emoji + self.event_type = event_type try: self.guild_id = int(data['guild_id']) |