diff --git a/changelog/1040.feature.rst b/changelog/1040.feature.rst new file mode 100644 index 0000000000..b1119f3542 --- /dev/null +++ b/changelog/1040.feature.rst @@ -0,0 +1 @@ +Support ``animated`` emoji field in reaction removal events (e.g. :func:`on_raw_reaction_remove`). diff --git a/disnake/raw_models.py b/disnake/raw_models.py index af3bec90cd..cbd3686644 100644 --- a/disnake/raw_models.py +++ b/disnake/raw_models.py @@ -164,6 +164,10 @@ class RawReactionActionEvent(_RawReprMixin): The guild ID where the reaction addition or removal took place, if applicable. emoji: :class:`PartialEmoji` The custom or unicode emoji being used. + + .. versionchanged:: 2.9 + This now also includes the correct :attr:`~PartialEmoji.animated` value when a reaction was removed. + member: Optional[:class:`Member`] The member who added the reaction. Only available if `event_type` is `REACTION_ADD` and the reaction is inside a guild. @@ -236,6 +240,9 @@ class RawReactionClearEmojiEvent(_RawReprMixin): The guild ID where the reaction clear took place, if applicable. emoji: :class:`PartialEmoji` The custom or unicode emoji being removed. + + .. versionchanged:: 2.9 + This now also includes the correct :attr:`~PartialEmoji.animated` value. """ __slots__ = ("message_id", "channel_id", "guild_id", "emoji") diff --git a/disnake/state.py b/disnake/state.py index 5e4725fb4c..ca915aa33f 100644 --- a/disnake/state.py +++ b/disnake/state.py @@ -885,6 +885,7 @@ def parse_message_reaction_remove(self, data: gateway.MessageReactionRemoveEvent emoji = PartialEmoji.with_state( self, id=emoji_id, + animated=emoji.get("animated", False), # may be `None` in gateway events if custom emoji data isn't available anymore # https://discord.com/developers/docs/resources/emoji#emoji-object-custom-emoji-examples name=emoji["name"], # type: ignore @@ -912,6 +913,7 @@ def parse_message_reaction_remove_emoji( emoji = PartialEmoji.with_state( self, id=emoji_id, + animated=emoji.get("animated", False), # may be `None` in gateway events if custom emoji data isn't available anymore # https://discord.com/developers/docs/resources/emoji#emoji-object-custom-emoji-examples name=emoji["name"], # type: ignore