Add invite targets for voice channel invites

This commit is contained in:
Zomatree
2021-05-29 05:15:46 +01:00
committed by GitHub
parent f321efd4de
commit b48f510e15
10 changed files with 263 additions and 27 deletions

View File

@@ -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):