Add int() support to Emoji

This commit is contained in:
Arthur Jovart 2021-08-29 01:05:28 +02:00
parent 31e3e99c2b
commit 3ce86f6cde
No known key found for this signature in database
GPG Key ID: DE4444AAAAAAAAAA

View File

@ -72,6 +72,10 @@ class Emoji(_EmojiTag, AssetMixin):
Returns the emoji rendered for discord.
.. describe:: int(x)
Returns the emoji ID.
Attributes
-----------
name: :class:`str`
@ -137,6 +141,9 @@ class Emoji(_EmojiTag, AssetMixin):
return f'<a:{self.name}:{self.id}>'
return f'<:{self.name}:{self.id}>'
def __int__(self) -> int:
return self.id
def __repr__(self) -> str:
return f'<Emoji id={self.id} name={self.name!r} animated={self.animated} managed={self.managed}>'