Add Client.get_emoji to get an Emoji from an ID.

This commit is contained in:
Rapptz 2017-04-30 02:53:05 -04:00
parent d3a86a5fb6
commit 10453d6718
2 changed files with 7 additions and 0 deletions

View File

@ -532,6 +532,10 @@ class Client:
"""Returns a :class:`User` with the given ID. If not found, returns None."""
return self.connection.get_user(id)
def get_emoji(self, id):
"""Returns a :class:`Emoji` with the given ID. If not found, returns None."""
return self.connection.get_emoji(id)
def get_all_channels(self):
"""A generator that retrieves every :class:`Channel` the client can 'access'.

View File

@ -164,6 +164,9 @@ class ConnectionState:
def emojis(self):
return list(self._emojis.values())
def get_emoji(self, emoji_id):
return self._emojis.get(emoji_id)
@property
def private_channels(self):
return list(self._private_channels.values())