diff options
| author | Zomatree <[email protected]> | 2021-05-29 05:15:46 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-29 00:15:46 -0400 |
| commit | b48f510e154e40b8ba3bef58e5c513fccf90c89c (patch) | |
| tree | 917f2da2ee25e0fcac4fbc9e3762d89c4d10e604 /discord/http.py | |
| parent | Default SelectOption.value to the label if not given (diff) | |
| download | discord.py-b48f510e154e40b8ba3bef58e5c513fccf90c89c.tar.xz discord.py-b48f510e154e40b8ba3bef58e5c513fccf90c89c.zip | |
Add invite targets for voice channel invites
Diffstat (limited to 'discord/http.py')
| -rw-r--r-- | discord/http.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/discord/http.py b/discord/http.py index 67529495..c14cc8d4 100644 --- a/discord/http.py +++ b/discord/http.py @@ -981,6 +981,9 @@ class HTTPClient: max_uses: int = 0, temporary: bool = False, unique: bool = True, + target_type: Optional[int] = None, + target_user_id: Optional[int] = None, + target_application_id: Optional[int] = None ) -> Response[invite.Invite]: r = Route('POST', '/channels/{channel_id}/invites', channel_id=channel_id) payload = { @@ -990,6 +993,15 @@ class HTTPClient: 'unique': unique, } + if target_type: + payload['target_type'] = target_type + + if target_user_id: + payload['target_user_id'] = target_user_id + + if target_application_id: + payload['target_application_id'] = str(target_application_id) + return self.request(r, reason=reason, json=payload) def get_invite(self, invite_id, *, with_counts=True, with_expiration=True): |