diff options
| author | NCPlayz <[email protected]> | 2019-03-21 19:59:58 +0000 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-04-06 19:12:50 -0400 |
| commit | be227ebcf0c8bad6b56798339b5414b8da414dc0 (patch) | |
| tree | c7ea93ffc51e9a490b42d36e5c734b6b19ec3909 /discord/state.py | |
| parent | Propagate Cloudflare 429 HTML text. (diff) | |
| download | discord.py-be227ebcf0c8bad6b56798339b5414b8da414dc0.tar.xz discord.py-be227ebcf0c8bad6b56798339b5414b8da414dc0.zip | |
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
Diffstat (limited to 'discord/state.py')
| -rw-r--r-- | discord/state.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/state.py b/discord/state.py index 5614375a..ebde9ec0 100644 --- a/discord/state.py +++ b/discord/state.py @@ -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) |