diff options
| author | Eugene <[email protected]> | 2020-05-29 22:45:20 +0300 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-05-29 23:24:46 -0400 |
| commit | b3d2e2496869bf42cbdb5cd3eb6cbbb108a90d37 (patch) | |
| tree | 90e52dd4911ac52c1854da657df5660bbbd05945 | |
| parent | Add user_ids fields for query_members (diff) | |
| download | discord.py-b3d2e2496869bf42cbdb5cd3eb6cbbb108a90d37.tar.xz discord.py-b3d2e2496869bf42cbdb5cd3eb6cbbb108a90d37.zip | |
Fix possibility of PartialEmoji.id being a string
| -rw-r--r-- | discord/partial_emoji.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/discord/partial_emoji.py b/discord/partial_emoji.py index 1089815e..42f38a48 100644 --- a/discord/partial_emoji.py +++ b/discord/partial_emoji.py @@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE. """ from .asset import Asset +from . import utils + class _EmojiTag: __slots__ = () @@ -77,7 +79,11 @@ class PartialEmoji(_EmojiTag): @classmethod def from_dict(cls, data): - return cls(animated=data.get('animated', False), id=data.get('id'), name=data.get('name')) + return cls( + animated=data.get('animated', False), + id=utils._get_as_snowflake(data, 'id'), + name=data.get('name'), + ) def to_dict(self): o = { 'name': self.name } |