diff options
| author | Rapptz <[email protected]> | 2017-04-30 02:53:05 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-04-30 02:53:05 -0400 |
| commit | 10453d671819b16de32410418ec8e5d803e654bf (patch) | |
| tree | ea4057baee826c95f2549cd83baaf08a1c23ccc1 | |
| parent | Add TextChannel.is_nsfw method to check for NSFW channels. (diff) | |
| download | discord.py-10453d671819b16de32410418ec8e5d803e654bf.tar.xz discord.py-10453d671819b16de32410418ec8e5d803e654bf.zip | |
Add Client.get_emoji to get an Emoji from an ID.
| -rw-r--r-- | discord/client.py | 4 | ||||
| -rw-r--r-- | discord/state.py | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py index e1b2a798..6979df06 100644 --- a/discord/client.py +++ b/discord/client.py @@ -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'. diff --git a/discord/state.py b/discord/state.py index 6ac83bd1..f491bca5 100644 --- a/discord/state.py +++ b/discord/state.py @@ -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()) |