mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-08 10:53:10 +00:00
Redesign asset retrieval in the library.
Most assets now return a new class named `Asset`. This allows for the assets to be consistently saved via a `save` method instead of special casing for `Attachment`. `AppInfo` is no longer a namedtuple it is a fully documented dataclass, as well as having the state attached to it. Fixes #1997
This commit is contained in:
@ -402,7 +402,7 @@ class ConnectionState:
|
||||
def parse_message_reaction_add(self, data):
|
||||
emoji_data = data['emoji']
|
||||
emoji_id = utils._get_as_snowflake(emoji_data, 'id')
|
||||
emoji = PartialEmoji(animated=emoji_data['animated'], id=emoji_id, name=emoji_data['name'])
|
||||
emoji = PartialEmoji.with_state(self, animated=emoji_data['animated'], id=emoji_id, name=emoji_data['name'])
|
||||
raw = RawReactionActionEvent(data, emoji)
|
||||
self.dispatch('raw_reaction_add', raw)
|
||||
|
||||
@ -428,7 +428,7 @@ class ConnectionState:
|
||||
def parse_message_reaction_remove(self, data):
|
||||
emoji_data = data['emoji']
|
||||
emoji_id = utils._get_as_snowflake(emoji_data, 'id')
|
||||
emoji = PartialEmoji(animated=emoji_data['animated'], id=emoji_id, name=emoji_data['name'])
|
||||
emoji = PartialEmoji.with_state(self, animated=emoji_data['animated'], id=emoji_id, name=emoji_data['name'])
|
||||
raw = RawReactionActionEvent(data, emoji)
|
||||
self.dispatch('raw_reaction_remove', raw)
|
||||
|
||||
|
Reference in New Issue
Block a user