Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions interactions/api/models/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,19 @@ async def delete(
guild_id=guild_id, emoji_id=int(self.id), reason=reason
)

@property
def url(self) -> str:
"""
Returns the emoji's url.
:return URL of the emoji
:rtype: str
"""
if not self._client:
raise AttributeError("HTTPClient not found!")
url = f"https://cdn.discordapp.com/emojis/{self.id}"
url += ".gif" if self.animated else ".png"
return url


class ReactionObject(DictSerializerMixin):
"""The reaction object.
Expand Down
2 changes: 2 additions & 0 deletions interactions/api/models/message.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ class Emoji(DictSerializerMixin):
guild_id: int,
reason: Optional[str] = None,
) -> None: ...
@property
def url(self) -> str: ...

class ReactionObject(DictSerializerMixin):
_json: dict
Expand Down