From c8f32f31514475fe954fbcc1516e4798810f8e07 Mon Sep 17 00:00:00 2001 From: NCPlayz Date: Sun, 5 Apr 2020 21:40:00 +0100 Subject: [PATCH] animated key is never given to reaction_remove(_emoji) --- discord/partial_emoji.py | 4 ++-- discord/state.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/discord/partial_emoji.py b/discord/partial_emoji.py index 6819d649c..1089815eb 100644 --- a/discord/partial_emoji.py +++ b/discord/partial_emoji.py @@ -88,8 +88,8 @@ class PartialEmoji(_EmojiTag): return o @classmethod - def with_state(cls, state, *, animated, name, id=None): - self = cls(animated=animated, name=name, id=id) + def with_state(cls, state, *, name, animated=False, id=None): + self = cls(name=name, animated=animated, id=id) self._state = state return self diff --git a/discord/state.py b/discord/state.py index 07282bd79..fcfed7d94 100644 --- a/discord/state.py +++ b/discord/state.py @@ -466,7 +466,7 @@ class ConnectionState: def parse_message_reaction_add(self, data): emoji = data['emoji'] emoji_id = utils._get_as_snowflake(emoji, 'id') - emoji = PartialEmoji.with_state(self, animated=emoji.get('animated', False), id=emoji_id, name=emoji['name']) + emoji = PartialEmoji.with_state(self, id=emoji_id, animated=emoji.get('animated', False), name=emoji['name']) raw = RawReactionActionEvent(data, emoji, 'REACTION_ADD') member_data = data.get('member') @@ -500,7 +500,7 @@ class ConnectionState: def parse_message_reaction_remove(self, data): emoji = data['emoji'] emoji_id = utils._get_as_snowflake(emoji, 'id') - emoji = PartialEmoji.with_state(self, animated=emoji.get('animated', False), id=emoji_id, name=emoji['name']) + emoji = PartialEmoji.with_state(self, id=emoji_id, name=emoji['name']) raw = RawReactionActionEvent(data, emoji, 'REACTION_REMOVE') self.dispatch('raw_reaction_remove', raw) @@ -519,7 +519,7 @@ class ConnectionState: def parse_message_reaction_remove_emoji(self, data): emoji = data['emoji'] emoji_id = utils._get_as_snowflake(emoji, 'id') - emoji = PartialEmoji.with_state(self, animated=emoji.get('animated', False), id=emoji_id, name=emoji['name']) + emoji = PartialEmoji.with_state(self, id=emoji_id, name=emoji['name']) raw = RawReactionClearEmojiEvent(data, emoji) self.dispatch('raw_reaction_clear_emoji', raw)