Browse Source

Add animated=true parameter to animated emoji

v2.6.x
Rapptz 2 days ago
parent
commit
fed237cdd6
  1. 4
      discord/emoji.py
  2. 4
      discord/partial_emoji.py

4
discord/emoji.py

@ -165,8 +165,8 @@ class Emoji(_EmojiTag, AssetMixin):
@property @property
def url(self) -> str: def url(self) -> str:
""":class:`str`: Returns the URL of the emoji.""" """:class:`str`: Returns the URL of the emoji."""
fmt = 'webp' if self.animated else 'png' end = 'webp?animated=true' if self.animated else 'png'
return f'{Asset.BASE}/emojis/{self.id}.{fmt}' return f'{Asset.BASE}/emojis/{self.id}.{end}'
@property @property
def roles(self) -> List[Role]: def roles(self) -> List[Role]:

4
discord/partial_emoji.py

@ -245,8 +245,8 @@ class PartialEmoji(_EmojiTag, AssetMixin):
if self.is_unicode_emoji(): if self.is_unicode_emoji():
return '' return ''
fmt = 'webp' if self.animated else 'png' end = 'webp?animated=true' if self.animated else 'png'
return f'{Asset.BASE}/emojis/{self.id}.{fmt}' return f'{Asset.BASE}/emojis/{self.id}.{end}'
async def read(self) -> bytes: async def read(self) -> bytes:
"""|coro| """|coro|

Loading…
Cancel
Save