Fix possibility of PartialEmoji.id being a string

This commit is contained in:
Eugene 2020-05-29 22:45:20 +03:00 committed by Rapptz
parent a972c95f12
commit b3d2e24968

View File

@ -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 }