mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-17 03:09:05 +00:00
Add Guild.get_emoji helper
This commit is contained in:
parent
dc9fb1fd84
commit
198425707e
@ -737,6 +737,26 @@ class Guild(Hashable):
|
|||||||
"""
|
"""
|
||||||
return self._threads.get(thread_id)
|
return self._threads.get(thread_id)
|
||||||
|
|
||||||
|
def get_emoji(self, emoji_id: int, /) -> Optional[Emoji]:
|
||||||
|
"""Returns an emoji with the given ID.
|
||||||
|
|
||||||
|
.. versionadded:: 2.3
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
emoji_id: int
|
||||||
|
The ID to search for.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
--------
|
||||||
|
Optional[:class:`Emoji`]
|
||||||
|
The returned Emoji or ``None`` if not found.
|
||||||
|
"""
|
||||||
|
emoji = self._state.get_emoji(emoji_id)
|
||||||
|
if emoji and emoji.guild == self:
|
||||||
|
return emoji
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def system_channel(self) -> Optional[TextChannel]:
|
def system_channel(self) -> Optional[TextChannel]:
|
||||||
"""Optional[:class:`TextChannel`]: Returns the guild's channel used for system messages.
|
"""Optional[:class:`TextChannel`]: Returns the guild's channel used for system messages.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user