mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-03 00:25:14 +00:00
Add support for Interaction Callback Resource
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
@ -90,6 +90,9 @@ if TYPE_CHECKING:
|
||||
)
|
||||
from ..types.emoji import PartialEmoji as PartialEmojiPayload
|
||||
from ..types.snowflake import SnowflakeList
|
||||
from ..types.interactions import (
|
||||
InteractionCallback as InteractionCallbackResponsePayload,
|
||||
)
|
||||
|
||||
BE = TypeVar('BE', bound=BaseException)
|
||||
_State = Union[ConnectionState, '_WebhookState']
|
||||
@ -435,13 +438,14 @@ class AsyncWebhookAdapter:
|
||||
proxy: Optional[str] = None,
|
||||
proxy_auth: Optional[aiohttp.BasicAuth] = None,
|
||||
params: MultipartParameters,
|
||||
) -> Response[None]:
|
||||
) -> Response[InteractionCallbackResponsePayload]:
|
||||
route = Route(
|
||||
'POST',
|
||||
'/interactions/{webhook_id}/{webhook_token}/callback',
|
||||
webhook_id=interaction_id,
|
||||
webhook_token=token,
|
||||
)
|
||||
request_params = {'with_response': '1'}
|
||||
|
||||
if params.files:
|
||||
return self.request(
|
||||
@ -451,9 +455,17 @@ class AsyncWebhookAdapter:
|
||||
proxy_auth=proxy_auth,
|
||||
files=params.files,
|
||||
multipart=params.multipart,
|
||||
params=request_params,
|
||||
)
|
||||
else:
|
||||
return self.request(route, session=session, proxy=proxy, proxy_auth=proxy_auth, payload=params.payload)
|
||||
return self.request(
|
||||
route,
|
||||
session=session,
|
||||
proxy=proxy,
|
||||
proxy_auth=proxy_auth,
|
||||
payload=params.payload,
|
||||
params=request_params,
|
||||
)
|
||||
|
||||
def get_original_interaction_response(
|
||||
self,
|
||||
|
Reference in New Issue
Block a user