diff options
Diffstat (limited to 'discord/client.py')
| -rw-r--r-- | discord/client.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/discord/client.py b/discord/client.py index f832efcc..26e22df9 100644 --- a/discord/client.py +++ b/discord/client.py @@ -882,7 +882,7 @@ class Client: # Invite management - async def get_invite(self, url): + async def get_invite(self, url, *, with_counts=True): """|coro| Gets an :class:`Invite` from a discord.gg URL or ID. @@ -890,13 +890,17 @@ class Client: Note ------ If the invite is for a guild you have not joined, the guild and channel - attributes of the returned invite will be :class:`Object` with the names - patched in. + attributes of the returned :class:`Invite` will be :class:`PartialInviteGuild` and + :class:`PartialInviteChannel` respectively. Parameters ----------- - url : str + url: :class:`str` The discord invite ID or URL (must be a discord.gg URL). + with_counts: :class:`bool` + Whether to include count information in the invite. This fills the + :attr:`Invite.approximate_member_count` and :attr:`Invite.approximate_presence_count` + fields. Raises ------- @@ -912,7 +916,7 @@ class Client: """ invite_id = self._resolve_invite(url) - data = await self.http.get_invite(invite_id) + data = await self.http.get_invite(invite_id, with_counts=with_counts) return Invite.from_incomplete(state=self._connection, data=data) async def delete_invite(self, invite): |