diff options
| author | Rapptz <[email protected]> | 2019-02-12 20:21:29 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-02-12 20:22:47 -0500 |
| commit | 5d78f43e558cdd55e22eb12a090d3d75fd258a8e (patch) | |
| tree | 9485cf47c706eef9eb315c897e589702423a697a /discord/http.py | |
| parent | Bump aiohttp requirement and fix AsyncWebhookAdapter (diff) | |
| download | discord.py-5d78f43e558cdd55e22eb12a090d3d75fd258a8e.tar.xz discord.py-5d78f43e558cdd55e22eb12a090d3d75fd258a8e.zip | |
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
Diffstat (limited to 'discord/http.py')
| -rw-r--r-- | discord/http.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/discord/http.py b/discord/http.py index 75c02457..cde1a373 100644 --- a/discord/http.py +++ b/discord/http.py @@ -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)) |