Browse Source

animated key is never given to reaction_remove(_emoji)

pull/2639/head
NCPlayz 5 years ago
committed by Rapptz
parent
commit
c8f32f3151
  1. 4
      discord/partial_emoji.py
  2. 6
      discord/state.py

4
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

6
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)

Loading…
Cancel
Save