mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +00:00
@ -356,10 +356,13 @@ class Interaction:
|
||||
raise ClientException('Channel for message could not be resolved')
|
||||
|
||||
adapter = async_context.get()
|
||||
http = self._state.http
|
||||
data = await adapter.get_original_interaction_response(
|
||||
application_id=self.application_id,
|
||||
token=self.token,
|
||||
session=self._session,
|
||||
proxy=http.proxy,
|
||||
proxy_auth=http.proxy_auth,
|
||||
)
|
||||
state = _InteractionMessageState(self, self._state)
|
||||
# The state and channel parameters are mocked here
|
||||
@ -441,10 +444,13 @@ class Interaction:
|
||||
previous_allowed_mentions=previous_mentions,
|
||||
)
|
||||
adapter = async_context.get()
|
||||
http = self._state.http
|
||||
data = await adapter.edit_original_interaction_response(
|
||||
self.application_id,
|
||||
self.token,
|
||||
session=self._session,
|
||||
proxy=http.proxy,
|
||||
proxy_auth=http.proxy_auth,
|
||||
payload=params.payload,
|
||||
multipart=params.multipart,
|
||||
files=params.files,
|
||||
@ -475,10 +481,13 @@ class Interaction:
|
||||
Deleted a message that is not yours.
|
||||
"""
|
||||
adapter = async_context.get()
|
||||
http = self._state.http
|
||||
await adapter.delete_original_interaction_response(
|
||||
self.application_id,
|
||||
self.token,
|
||||
session=self._session,
|
||||
proxy=http.proxy,
|
||||
proxy_auth=http.proxy_auth,
|
||||
)
|
||||
|
||||
|
||||
@ -561,7 +570,15 @@ class InteractionResponse:
|
||||
if defer_type:
|
||||
adapter = async_context.get()
|
||||
params = interaction_response_params(type=defer_type, data=data)
|
||||
await adapter.create_interaction_response(parent.id, parent.token, session=parent._session, params=params)
|
||||
http = parent._state.http
|
||||
await adapter.create_interaction_response(
|
||||
parent.id,
|
||||
parent.token,
|
||||
session=parent._session,
|
||||
proxy=http.proxy,
|
||||
proxy_auth=http.proxy_auth,
|
||||
params=params,
|
||||
)
|
||||
self._responded = True
|
||||
|
||||
async def pong(self) -> None:
|
||||
@ -585,7 +602,15 @@ class InteractionResponse:
|
||||
if parent.type is InteractionType.ping:
|
||||
adapter = async_context.get()
|
||||
params = interaction_response_params(InteractionResponseType.pong.value)
|
||||
await adapter.create_interaction_response(parent.id, parent.token, session=parent._session, params=params)
|
||||
http = parent._state.http
|
||||
await adapter.create_interaction_response(
|
||||
parent.id,
|
||||
parent.token,
|
||||
session=parent._session,
|
||||
proxy=http.proxy,
|
||||
proxy_auth=http.proxy_auth,
|
||||
params=params,
|
||||
)
|
||||
self._responded = True
|
||||
|
||||
async def send_message(
|
||||
@ -671,10 +696,13 @@ class InteractionResponse:
|
||||
view=view,
|
||||
)
|
||||
|
||||
http = parent._state.http
|
||||
await adapter.create_interaction_response(
|
||||
parent.id,
|
||||
parent.token,
|
||||
session=parent._session,
|
||||
proxy=http.proxy,
|
||||
proxy_auth=http.proxy_auth,
|
||||
params=params,
|
||||
)
|
||||
|
||||
@ -762,10 +790,13 @@ class InteractionResponse:
|
||||
allowed_mentions=allowed_mentions,
|
||||
)
|
||||
|
||||
http = parent._state.http
|
||||
await adapter.create_interaction_response(
|
||||
parent.id,
|
||||
parent.token,
|
||||
session=parent._session,
|
||||
proxy=http.proxy,
|
||||
proxy_auth=http.proxy_auth,
|
||||
params=params,
|
||||
)
|
||||
|
||||
@ -797,12 +828,15 @@ class InteractionResponse:
|
||||
parent = self._parent
|
||||
|
||||
adapter = async_context.get()
|
||||
http = parent._state.http
|
||||
|
||||
params = interaction_response_params(InteractionResponseType.modal.value, modal.to_dict())
|
||||
await adapter.create_interaction_response(
|
||||
parent.id,
|
||||
parent.token,
|
||||
session=parent._session,
|
||||
proxy=http.proxy,
|
||||
proxy_auth=http.proxy_auth,
|
||||
params=params,
|
||||
)
|
||||
|
||||
@ -840,11 +874,14 @@ class InteractionResponse:
|
||||
raise ValueError('cannot respond to this interaction with autocomplete.')
|
||||
|
||||
adapter = async_context.get()
|
||||
http = parent._state.http
|
||||
params = interaction_response_params(type=InteractionResponseType.autocomplete_result.value, data=payload)
|
||||
await adapter.create_interaction_response(
|
||||
parent.id,
|
||||
parent.token,
|
||||
session=parent._session,
|
||||
proxy=http.proxy,
|
||||
proxy_auth=http.proxy_auth,
|
||||
params=params,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user