|
|
@ -332,6 +332,79 @@ class AsyncWebhookAdapter: |
|
|
|
route = Route('GET', '/webhooks/{webhook_id}/{webhook_token}', webhook_id=webhook_id, webhook_token=token) |
|
|
|
return self.request(route, session=session) |
|
|
|
|
|
|
|
def create_interaction_response( |
|
|
|
self, |
|
|
|
interaction_id: int, |
|
|
|
token: str, |
|
|
|
*, |
|
|
|
session: aiohttp.ClientSession, |
|
|
|
type: int, |
|
|
|
data: Optional[Dict[str, Any]] = None, |
|
|
|
): |
|
|
|
payload: Dict[str, Any] = { |
|
|
|
'type': type, |
|
|
|
} |
|
|
|
|
|
|
|
if data is not None: |
|
|
|
payload['data'] = data |
|
|
|
|
|
|
|
route = Route( |
|
|
|
'POST', |
|
|
|
'/interactions/{webhook_id}/{webhook_token}/callback', |
|
|
|
webhook_id=interaction_id, |
|
|
|
webhook_token=token, |
|
|
|
) |
|
|
|
|
|
|
|
return self.request(route, session=session, payload=payload) |
|
|
|
|
|
|
|
def get_original_interaction_response( |
|
|
|
self, |
|
|
|
application_id: int, |
|
|
|
token: str, |
|
|
|
*, |
|
|
|
session: aiohttp.ClientSession, |
|
|
|
): |
|
|
|
r = Route( |
|
|
|
'GET', |
|
|
|
'/webhooks/{webhook_id}/{webhook_token}/messages/@original', |
|
|
|
webhook_id=application_id, |
|
|
|
webhook_token=token, |
|
|
|
) |
|
|
|
return self.request(r, session=session) |
|
|
|
|
|
|
|
def edit_original_interaction_response( |
|
|
|
self, |
|
|
|
application_id: int, |
|
|
|
token: str, |
|
|
|
*, |
|
|
|
session: aiohttp.ClientSession, |
|
|
|
payload: Optional[Dict[str, Any]] = None, |
|
|
|
multipart: Optional[List[Dict[str, Any]]] = None, |
|
|
|
files: Optional[List[File]] = None, |
|
|
|
): |
|
|
|
r = Route( |
|
|
|
'PATCH', |
|
|
|
'/webhooks/{webhook_id}/{webhook_token}/messages/@original', |
|
|
|
webhook_id=application_id, |
|
|
|
webhook_token=token, |
|
|
|
) |
|
|
|
return self.request(r, session, payload=payload, multipart=multipart, files=files) |
|
|
|
|
|
|
|
def delete_original_interaction_response( |
|
|
|
self, |
|
|
|
application_id: int, |
|
|
|
token: str, |
|
|
|
*, |
|
|
|
session: aiohttp.ClientSession, |
|
|
|
): |
|
|
|
r = Route( |
|
|
|
'DELETE', |
|
|
|
'/webhooks/{webhook_id}/{wehook_token}/messages/@original', |
|
|
|
webhook_id=application_id, |
|
|
|
wehook_token=token, |
|
|
|
) |
|
|
|
return self.request(r, session=session) |
|
|
|
|
|
|
|
|
|
|
|
class ExecuteWebhookParameters(NamedTuple): |
|
|
|
payload: Optional[Dict[str, Any]] |
|
|
|