mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-12-04 22:42:21 +00:00
Add invite targets for voice channel invites
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user