Skip to content

Commit 1cdf710

Browse files
committed
Rename InteractionCallback to InteractionCallbackResponse
1 parent 776fc22 commit 1cdf710

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

discord/interactions.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
'Interaction',
5555
'InteractionMessage',
5656
'InteractionResponse',
57-
'InteractionCallback',
57+
'InteractionCallbackResponse',
5858
'InteractionCallbackActivityInstance',
5959
)
6060

@@ -659,7 +659,7 @@ def __init__(self, data: InteractionCallbackActivityPayload) -> None:
659659
self.id: str = data['id']
660660

661661

662-
class InteractionCallback(Generic[ClientT]):
662+
class InteractionCallbackResponse(Generic[ClientT]):
663663
"""Represents an interaction response callback.
664664
665665
.. versionadded:: 2.5
@@ -776,7 +776,7 @@ async def defer(
776776
*,
777777
ephemeral: bool = False,
778778
thinking: bool = False,
779-
) -> Optional[InteractionCallback[ClientT]]:
779+
) -> Optional[InteractionCallbackResponse[ClientT]]:
780780
"""|coro|
781781
782782
Defers the interaction response.
@@ -791,7 +791,7 @@ async def defer(
791791
- :attr:`InteractionType.modal_submit`
792792
793793
.. versionchanged:: 2.5
794-
This now returns a :class:`InteractionCallback` instance.
794+
This now returns a :class:`InteractionCallbackResponse` instance.
795795
796796
Parameters
797797
-----------
@@ -814,7 +814,7 @@ async def defer(
814814
815815
Returns
816816
-------
817-
Optional[:class:`InteractionCallback`]
817+
Optional[:class:`InteractionCallbackResponse`]
818818
The interaction callback resource, or ``None``.
819819
"""
820820
if self._response_type:
@@ -849,7 +849,7 @@ async def defer(
849849
params=params,
850850
)
851851
self._response_type = InteractionResponseType(defer_type)
852-
return InteractionCallback(
852+
return InteractionCallbackResponse(
853853
data=response,
854854
parent=self._parent,
855855
state=self._parent._state,
@@ -904,13 +904,13 @@ async def send_message(
904904
silent: bool = False,
905905
delete_after: Optional[float] = None,
906906
poll: Poll = MISSING,
907-
) -> InteractionCallback[ClientT]:
907+
) -> InteractionCallbackResponse[ClientT]:
908908
"""|coro|
909909
910910
Responds to this interaction by sending a message.
911911
912912
.. versionchanged:: 2.5
913-
This now returns a :class:`InteractionCallback` instance.
913+
This now returns a :class:`InteractionCallbackResponse` instance.
914914
915915
Parameters
916916
-----------
@@ -968,7 +968,7 @@ async def send_message(
968968
969969
Returns
970970
-------
971-
:class:`InteractionCallback`
971+
:class:`InteractionCallbackResponse`
972972
The interaction callback data.
973973
"""
974974
if self._response_type:
@@ -1031,7 +1031,7 @@ async def inner_call(delay: float = delete_after):
10311031

10321032
asyncio.create_task(inner_call())
10331033

1034-
return InteractionCallback(
1034+
return InteractionCallbackResponse(
10351035
data=response,
10361036
parent=self._parent,
10371037
state=self._parent._state,
@@ -1049,14 +1049,14 @@ async def edit_message(
10491049
allowed_mentions: Optional[AllowedMentions] = MISSING,
10501050
delete_after: Optional[float] = None,
10511051
suppress_embeds: bool = MISSING,
1052-
) -> Optional[InteractionCallback[ClientT]]:
1052+
) -> Optional[InteractionCallbackResponse[ClientT]]:
10531053
"""|coro|
10541054
10551055
Responds to this interaction by editing the original message of
10561056
a component or modal interaction.
10571057
10581058
.. versionchanged:: 2.5
1059-
This now returns a :class:`InteractionCallback` instance.
1059+
This now returns a :class:`InteractionCallbackResponse` instance.
10601060
10611061
Parameters
10621062
-----------
@@ -1106,7 +1106,7 @@ async def edit_message(
11061106
11071107
Returns
11081108
-------
1109-
Optional[:class:`InteractionCallback`]
1109+
Optional[:class:`InteractionCallbackResponse`]
11101110
The interaction callback data, or ``None`` if editing the message was not possible.
11111111
"""
11121112
if self._response_type:
@@ -1175,20 +1175,20 @@ async def inner_call(delay: float = delete_after):
11751175

11761176
asyncio.create_task(inner_call())
11771177

1178-
return InteractionCallback(
1178+
return InteractionCallbackResponse(
11791179
data=response,
11801180
parent=self._parent,
11811181
state=self._parent._state,
11821182
type=self._response_type,
11831183
)
11841184

1185-
async def send_modal(self, modal: Modal, /) -> InteractionCallback[ClientT]:
1185+
async def send_modal(self, modal: Modal, /) -> InteractionCallbackResponse[ClientT]:
11861186
"""|coro|
11871187
11881188
Responds to this interaction by sending a modal.
11891189
11901190
.. versionchanged:: 2.5
1191-
This now returns a :class:`InteractionCallback` instance.
1191+
This now returns a :class:`InteractionCallbackResponse` instance.
11921192
11931193
Parameters
11941194
-----------
@@ -1208,7 +1208,7 @@ async def send_modal(self, modal: Modal, /) -> InteractionCallback[ClientT]:
12081208
12091209
Returns
12101210
-------
1211-
:class:`InteractionCallback`
1211+
:class:`InteractionCallbackResponse`
12121212
The interaction callback data.
12131213
"""
12141214
if self._response_type:
@@ -1232,7 +1232,7 @@ async def send_modal(self, modal: Modal, /) -> InteractionCallback[ClientT]:
12321232
self._parent._state.store_view(modal)
12331233
self._response_type = InteractionResponseType.modal
12341234

1235-
return InteractionCallback(
1235+
return InteractionCallbackResponse(
12361236
data=response,
12371237
parent=self._parent,
12381238
state=self._parent._state,

docs/interactions/api.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ InteractionResponse
2828
.. autoclass:: InteractionResponse()
2929
:members:
3030

31-
InteractionCallback
32-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
31+
InteractionCallbackResponse
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3333

34-
.. attributetable:: InteractionCallback
34+
.. attributetable:: InteractionCallbackResponse
3535

36-
.. autoclass:: InteractionCallback()
36+
.. autoclass:: InteractionCallbackResponse()
3737
:members:
3838

3939
InteractionCallbackActivityInstance

0 commit comments

Comments
 (0)