mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
Fix possibility of PartialEmoji.id being a string
This commit is contained in:
parent
a972c95f12
commit
b3d2e24968
@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from .asset import Asset
|
from .asset import Asset
|
||||||
|
from . import utils
|
||||||
|
|
||||||
|
|
||||||
class _EmojiTag:
|
class _EmojiTag:
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
@ -77,7 +79,11 @@ class PartialEmoji(_EmojiTag):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls, data):
|
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):
|
def to_dict(self):
|
||||||
o = { 'name': self.name }
|
o = { 'name': self.name }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user