From 10453d671819b16de32410418ec8e5d803e654bf Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 30 Apr 2017 02:53:05 -0400 Subject: [PATCH] Add Client.get_emoji to get an Emoji from an ID. --- discord/client.py | 4 ++++ discord/state.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/discord/client.py b/discord/client.py index e1b2a7983..6979df06d 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 6ac83bd12..f491bca5b 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())