diff options
| author | Rapptz <[email protected]> | 2019-07-23 04:01:14 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-07-23 04:01:14 -0400 |
| commit | 18fe2035ef33b9bbaa2f8504c787a40bdaf247fe (patch) | |
| tree | 34cd1752cc2628e09777e7c13cb6ef5425c0a1e6 /discord/client.py | |
| parent | Fix breakage with webhook tokens being missing. (diff) | |
| download | discord.py-18fe2035ef33b9bbaa2f8504c787a40bdaf247fe.tar.xz discord.py-18fe2035ef33b9bbaa2f8504c787a40bdaf247fe.zip | |
Document that the cache retrieval functions require an int ID.
Closes #2285
Diffstat (limited to 'discord/client.py')
| -rw-r--r-- | discord/client.py | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/discord/client.py b/discord/client.py index b4f83da2..c164fc09 100644 --- a/discord/client.py +++ b/discord/client.py @@ -658,31 +658,62 @@ class Client: return list(self._connection._users.values()) def get_channel(self, id): - """Optional[Union[:class:`.abc.GuildChannel`, :class:`.abc.PrivateChannel`]]: Returns a channel with the - given ID. + """Returns a channel with the given ID. - If not found, returns ``None``. + Parameters + ----------- + id: :class:`int` + The ID to search for. + + Returns + -------- + Optional[Union[:class:`.abc.GuildChannel`, :class:`.abc.PrivateChannel`]] + The returned channel or ``None`` if not found. """ return self._connection.get_channel(id) def get_guild(self, id): - """Optional[:class:`.Guild`]: Returns a guild with the given ID. + """Returns a guild with the given ID. - If not found, returns ``None``. + Parameters + ----------- + id: :class:`int` + The ID to search for. + + Returns + -------- + Optional[:class:`.Guild`] + The guild or ``None`` if not found. """ return self._connection._get_guild(id) def get_user(self, id): - """Optional[:class:`~discord.User`]: Returns a user with the given ID. + """Returns a user with the given ID. - If not found, returns ``None``. + Parameters + ----------- + id: :class:`int` + The ID to search for. + + Returns + -------- + Optional[:class:`~discord.User`] + The user or ``None`` if not found. """ return self._connection.get_user(id) def get_emoji(self, id): - """Optional[:class:`.Emoji`]: Returns an emoji with the given ID. + """Returns an emoji with the given ID. - If not found, returns ``None``. + Parameters + ----------- + id: :class:`int` + The ID to search for. + + Returns + -------- + Optional[:class:`.Emoji`] + The custom emoji or ``None`` if not found. """ return self._connection.get_emoji(id) |