mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Rename InteractionCallback to InteractionCallbackResponse
This commit is contained in:
parent
776fc2251d
commit
1cdf710908
@ -54,7 +54,7 @@ __all__ = (
|
|||||||
'Interaction',
|
'Interaction',
|
||||||
'InteractionMessage',
|
'InteractionMessage',
|
||||||
'InteractionResponse',
|
'InteractionResponse',
|
||||||
'InteractionCallback',
|
'InteractionCallbackResponse',
|
||||||
'InteractionCallbackActivityInstance',
|
'InteractionCallbackActivityInstance',
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -659,7 +659,7 @@ class InteractionCallbackActivityInstance:
|
|||||||
self.id: str = data['id']
|
self.id: str = data['id']
|
||||||
|
|
||||||
|
|
||||||
class InteractionCallback(Generic[ClientT]):
|
class InteractionCallbackResponse(Generic[ClientT]):
|
||||||
"""Represents an interaction response callback.
|
"""Represents an interaction response callback.
|
||||||
|
|
||||||
.. versionadded:: 2.5
|
.. versionadded:: 2.5
|
||||||
@ -776,7 +776,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
*,
|
*,
|
||||||
ephemeral: bool = False,
|
ephemeral: bool = False,
|
||||||
thinking: bool = False,
|
thinking: bool = False,
|
||||||
) -> Optional[InteractionCallback[ClientT]]:
|
) -> Optional[InteractionCallbackResponse[ClientT]]:
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Defers the interaction response.
|
Defers the interaction response.
|
||||||
@ -791,7 +791,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
- :attr:`InteractionType.modal_submit`
|
- :attr:`InteractionType.modal_submit`
|
||||||
|
|
||||||
.. versionchanged:: 2.5
|
.. versionchanged:: 2.5
|
||||||
This now returns a :class:`InteractionCallback` instance.
|
This now returns a :class:`InteractionCallbackResponse` instance.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
@ -814,7 +814,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
Optional[:class:`InteractionCallback`]
|
Optional[:class:`InteractionCallbackResponse`]
|
||||||
The interaction callback resource, or ``None``.
|
The interaction callback resource, or ``None``.
|
||||||
"""
|
"""
|
||||||
if self._response_type:
|
if self._response_type:
|
||||||
@ -849,7 +849,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
params=params,
|
params=params,
|
||||||
)
|
)
|
||||||
self._response_type = InteractionResponseType(defer_type)
|
self._response_type = InteractionResponseType(defer_type)
|
||||||
return InteractionCallback(
|
return InteractionCallbackResponse(
|
||||||
data=response,
|
data=response,
|
||||||
parent=self._parent,
|
parent=self._parent,
|
||||||
state=self._parent._state,
|
state=self._parent._state,
|
||||||
@ -904,13 +904,13 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
silent: bool = False,
|
silent: bool = False,
|
||||||
delete_after: Optional[float] = None,
|
delete_after: Optional[float] = None,
|
||||||
poll: Poll = MISSING,
|
poll: Poll = MISSING,
|
||||||
) -> InteractionCallback[ClientT]:
|
) -> InteractionCallbackResponse[ClientT]:
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Responds to this interaction by sending a message.
|
Responds to this interaction by sending a message.
|
||||||
|
|
||||||
.. versionchanged:: 2.5
|
.. versionchanged:: 2.5
|
||||||
This now returns a :class:`InteractionCallback` instance.
|
This now returns a :class:`InteractionCallbackResponse` instance.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
@ -968,7 +968,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
:class:`InteractionCallback`
|
:class:`InteractionCallbackResponse`
|
||||||
The interaction callback data.
|
The interaction callback data.
|
||||||
"""
|
"""
|
||||||
if self._response_type:
|
if self._response_type:
|
||||||
@ -1031,7 +1031,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
|
|
||||||
asyncio.create_task(inner_call())
|
asyncio.create_task(inner_call())
|
||||||
|
|
||||||
return InteractionCallback(
|
return InteractionCallbackResponse(
|
||||||
data=response,
|
data=response,
|
||||||
parent=self._parent,
|
parent=self._parent,
|
||||||
state=self._parent._state,
|
state=self._parent._state,
|
||||||
@ -1049,14 +1049,14 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
allowed_mentions: Optional[AllowedMentions] = MISSING,
|
allowed_mentions: Optional[AllowedMentions] = MISSING,
|
||||||
delete_after: Optional[float] = None,
|
delete_after: Optional[float] = None,
|
||||||
suppress_embeds: bool = MISSING,
|
suppress_embeds: bool = MISSING,
|
||||||
) -> Optional[InteractionCallback[ClientT]]:
|
) -> Optional[InteractionCallbackResponse[ClientT]]:
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Responds to this interaction by editing the original message of
|
Responds to this interaction by editing the original message of
|
||||||
a component or modal interaction.
|
a component or modal interaction.
|
||||||
|
|
||||||
.. versionchanged:: 2.5
|
.. versionchanged:: 2.5
|
||||||
This now returns a :class:`InteractionCallback` instance.
|
This now returns a :class:`InteractionCallbackResponse` instance.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
@ -1106,7 +1106,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
Optional[:class:`InteractionCallback`]
|
Optional[:class:`InteractionCallbackResponse`]
|
||||||
The interaction callback data, or ``None`` if editing the message was not possible.
|
The interaction callback data, or ``None`` if editing the message was not possible.
|
||||||
"""
|
"""
|
||||||
if self._response_type:
|
if self._response_type:
|
||||||
@ -1175,20 +1175,20 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
|
|
||||||
asyncio.create_task(inner_call())
|
asyncio.create_task(inner_call())
|
||||||
|
|
||||||
return InteractionCallback(
|
return InteractionCallbackResponse(
|
||||||
data=response,
|
data=response,
|
||||||
parent=self._parent,
|
parent=self._parent,
|
||||||
state=self._parent._state,
|
state=self._parent._state,
|
||||||
type=self._response_type,
|
type=self._response_type,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def send_modal(self, modal: Modal, /) -> InteractionCallback[ClientT]:
|
async def send_modal(self, modal: Modal, /) -> InteractionCallbackResponse[ClientT]:
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Responds to this interaction by sending a modal.
|
Responds to this interaction by sending a modal.
|
||||||
|
|
||||||
.. versionchanged:: 2.5
|
.. versionchanged:: 2.5
|
||||||
This now returns a :class:`InteractionCallback` instance.
|
This now returns a :class:`InteractionCallbackResponse` instance.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
@ -1208,7 +1208,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
:class:`InteractionCallback`
|
:class:`InteractionCallbackResponse`
|
||||||
The interaction callback data.
|
The interaction callback data.
|
||||||
"""
|
"""
|
||||||
if self._response_type:
|
if self._response_type:
|
||||||
@ -1232,7 +1232,7 @@ class InteractionResponse(Generic[ClientT]):
|
|||||||
self._parent._state.store_view(modal)
|
self._parent._state.store_view(modal)
|
||||||
self._response_type = InteractionResponseType.modal
|
self._response_type = InteractionResponseType.modal
|
||||||
|
|
||||||
return InteractionCallback(
|
return InteractionCallbackResponse(
|
||||||
data=response,
|
data=response,
|
||||||
parent=self._parent,
|
parent=self._parent,
|
||||||
state=self._parent._state,
|
state=self._parent._state,
|
||||||
|
@ -28,12 +28,12 @@ InteractionResponse
|
|||||||
.. autoclass:: InteractionResponse()
|
.. autoclass:: InteractionResponse()
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
InteractionCallback
|
InteractionCallbackResponse
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. attributetable:: InteractionCallback
|
.. attributetable:: InteractionCallbackResponse
|
||||||
|
|
||||||
.. autoclass:: InteractionCallback()
|
.. autoclass:: InteractionCallbackResponse()
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
InteractionCallbackActivityInstance
|
InteractionCallbackActivityInstance
|
||||||
|
Loading…
x
Reference in New Issue
Block a user