diff options
Diffstat (limited to 'discord/guild.py')
| -rw-r--r-- | discord/guild.py | 65 |
1 files changed, 11 insertions, 54 deletions
diff --git a/discord/guild.py b/discord/guild.py index d97f7bc9..07a7d974 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1485,58 +1485,6 @@ class Guild(Hashable): return result - async def fetch_emojis(self): - r"""|coro| - - Retrieves all custom :class:`Emoji`\s from the guild. - - .. note:: - - This method is an API call. For general usage, consider :attr:`emojis` instead. - - Raises - --------- - HTTPException - An error occurred fetching the emojis. - - Returns - -------- - List[:class:`Emoji`] - The retrieved emojis. - """ - data = await self._state.http.get_all_custom_emojis(self.id) - return [Emoji(guild=self, state=self._state, data=d) for d in data] - - async def fetch_emoji(self, emoji_id): - """|coro| - - Retrieves a custom :class:`Emoji` from the guild. - - .. note:: - - This method is an API call. - For general usage, consider iterating over :attr:`emojis` instead. - - Parameters - ------------- - emoji_id: :class:`int` - The emoji's ID. - - Raises - --------- - NotFound - The emoji requested could not be found. - HTTPException - An error occurred fetching the emoji. - - Returns - -------- - :class:`Emoji` - The retrieved emoji. - """ - data = await self._state.http.get_custom_emoji(self.id, emoji_id) - return Emoji(guild=self, state=self._state, data=data) - async def create_integration(self, *, type, id): """|coro| @@ -1589,9 +1537,13 @@ class Guild(Hashable): return [Integration(guild=self, data=d) for d in data] async def fetch_emojis(self): - """|coro| + r"""|coro| + + Retrieves all custom :class:`Emoji`\s from the guild. - Retrieves all custom :class:`Emoji`s from the guild. + .. note:: + + This method is an API call. For general usage, consider :attr:`emojis` instead. Raises --------- @@ -1611,6 +1563,11 @@ class Guild(Hashable): Retrieves a custom :class:`Emoji` from the guild. + .. note:: + + This method is an API call. + For general usage, consider iterating over :attr:`emojis` instead. + Parameters ------------- emoji_id: :class:`int` |