diff options
Diffstat (limited to 'discord/client.py')
| -rw-r--r-- | discord/client.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py index 8c6f4936..71e4bf6b 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1132,7 +1132,7 @@ class Client: # Invite management - async def fetch_invite(self, url: Union[Invite, str], *, with_counts: bool = True) -> Invite: + async def fetch_invite(self, url: Union[Invite, str], *, with_counts: bool = True, with_expiration: bool = True) -> Invite: """|coro| Gets an :class:`.Invite` from a discord.gg URL or ID. @@ -1151,6 +1151,11 @@ class Client: Whether to include count information in the invite. This fills the :attr:`.Invite.approximate_member_count` and :attr:`.Invite.approximate_presence_count` fields. + with_expiration: :class:`bool` + Whether to include the expiration date of the invite. This fills the + :attr:`.Invite.expires_at` field. + + .. versionadded:: 2.0 Raises ------- @@ -1166,7 +1171,7 @@ class Client: """ invite_id = utils.resolve_invite(url) - data = await self.http.get_invite(invite_id, with_counts=with_counts) + data = await self.http.get_invite(invite_id, with_counts=with_counts, with_expiration=with_expiration) return Invite.from_incomplete(state=self._connection, data=data) async def delete_invite(self, invite: Union[Invite, str]) -> None: |