Add animated=true parameter to animated emoji

This commit is contained in:
Rapptz
2025-10-14 17:33:49 -04:00
parent 7f76a31a26
commit fed237cdd6
2 changed files with 4 additions and 4 deletions

View File

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

View File

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