mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-08 10:53:10 +00:00
Expose more information from partial invites, along with counts.
This adds the following information. * `PartialInviteGuild` to replace `Object` patching * `PartialInviteChannel` to replace `Object` patching * Invite.approximate_member_count and Invite.approximate_presence_count The new partial objects provide better documentation on what is expected when you fetch random invites. Fixes #1830
This commit is contained in:
@ -647,8 +647,11 @@ class HTTPClient:
|
||||
|
||||
return self.request(r, reason=reason, json=payload)
|
||||
|
||||
def get_invite(self, invite_id):
|
||||
return self.request(Route('GET', '/invite/{invite_id}', invite_id=invite_id))
|
||||
def get_invite(self, invite_id, *, with_counts=True):
|
||||
params = {
|
||||
'with_counts': int(with_counts)
|
||||
}
|
||||
return self.request(Route('GET', '/invite/{invite_id}', invite_id=invite_id), params=params)
|
||||
|
||||
def invites_from(self, guild_id):
|
||||
return self.request(Route('GET', '/guilds/{guild_id}/invites', guild_id=guild_id))
|
||||
|
Reference in New Issue
Block a user