@@ -139,7 +139,7 @@ class Interaction:
139
139
"_app_permissions" ,
140
140
"_state" ,
141
141
"_session" ,
142
- "_original_message " ,
142
+ "_original_response " ,
143
143
"_cs_app_permissions" ,
144
144
"_cs_response" ,
145
145
"_cs_followup" ,
@@ -149,7 +149,7 @@ class Interaction:
149
149
def __init__ (self , * , data : InteractionPayload , state : ConnectionState ):
150
150
self ._state : ConnectionState = state
151
151
self ._session : ClientSession = state .http ._HTTPClient__session
152
- self ._original_message : Optional [InteractionMessage ] = None
152
+ self ._original_response : Optional [InteractionMessage ] = None
153
153
self ._from_data (data )
154
154
155
155
def _from_data (self , data : InteractionPayload ):
@@ -263,7 +263,7 @@ def followup(self) -> Webhook:
263
263
}
264
264
return Webhook .from_state (data = payload , state = self ._state )
265
265
266
- async def original_message (self ) -> InteractionMessage :
266
+ async def original_response (self ) -> InteractionMessage :
267
267
"""|coro|
268
268
269
269
Fetches the original interaction response message associated with the interaction.
@@ -287,8 +287,8 @@ async def original_message(self) -> InteractionMessage:
287
287
The original interaction response message.
288
288
"""
289
289
290
- if self ._original_message is not None :
291
- return self ._original_message
290
+ if self ._original_response is not None :
291
+ return self ._original_response
292
292
293
293
# TODO: fix later to not raise?
294
294
channel = self .channel
@@ -306,10 +306,28 @@ async def original_message(self) -> InteractionMessage:
306
306
)
307
307
state = _InteractionMessageState (self , self ._state )
308
308
message = InteractionMessage (state = state , channel = channel , data = data ) # type: ignore
309
- self ._original_message = message
309
+ self ._original_response = message
310
310
return message
311
311
312
- async def edit_original_message (
312
+ @utils .deprecated ("Interaction.original_response" , "2.1" )
313
+ async def original_message (self ):
314
+ """An alias for :meth:`original_response`.
315
+
316
+ Raises
317
+ -------
318
+ HTTPException
319
+ Fetching the original response message failed.
320
+ ClientException
321
+ The channel for the message could not be resolved.
322
+
323
+ Returns
324
+ --------
325
+ InteractionMessage
326
+ The original interaction response message.
327
+ """
328
+ return self .original_response ()
329
+
330
+ async def edit_original_response (
313
331
self ,
314
332
* ,
315
333
content : Optional [str ] = MISSING ,
@@ -409,11 +427,33 @@ async def edit_original_message(
409
427
self ._state .store_view (view , message .id )
410
428
411
429
if delete_after is not None :
412
- await self .delete_original_message (delay = delete_after )
430
+ await self .delete_original_response (delay = delete_after )
413
431
414
432
return message
415
433
416
- async def delete_original_message (self , * , delay : Optional [float ] = None ) -> None :
434
+ @utils .deprecated ("Interaction.edit_original_response" , "2.1" )
435
+ async def edit_original_message (self , ** kwargs ):
436
+ """An alias for :meth:`edit_original_response`.
437
+
438
+ Raises
439
+ -------
440
+ HTTPException
441
+ Editing the message failed.
442
+ Forbidden
443
+ Edited a message that is not yours.
444
+ TypeError
445
+ You specified both ``embed`` and ``embeds`` or ``file`` and ``files``
446
+ ValueError
447
+ The length of ``embeds`` was invalid.
448
+
449
+ Returns
450
+ --------
451
+ :class:`InteractionMessage`
452
+ The newly edited message.
453
+ """
454
+ return self .edit_original_response (** kwargs )
455
+
456
+ async def delete_original_response (self , * , delay : Optional [float ] = None ) -> None :
417
457
"""|coro|
418
458
419
459
Deletes the original interaction response message.
@@ -449,6 +489,19 @@ async def delete_original_message(self, *, delay: Optional[float] = None) -> Non
449
489
else :
450
490
await func
451
491
492
+ @utils .deprecated ("Interaction.delete_original_response" , "2.1" )
493
+ async def delete_original_message (self , ** kwargs ):
494
+ """An alias for :meth:`delete_original_response`.
495
+
496
+ Raises
497
+ -------
498
+ HTTPException
499
+ Deleting the message failed.
500
+ Forbidden
501
+ Deleted a message that is not yours.
502
+ """
503
+ return self .delete_original_response (** kwargs )
504
+
452
505
def to_dict (self ) -> Dict [str , Any ]:
453
506
"""
454
507
Converts this interaction object into a dict.
@@ -761,12 +814,12 @@ async def send_message(
761
814
if ephemeral and view .timeout is None :
762
815
view .timeout = 15 * 60.0
763
816
764
- view .message = await self ._parent .original_message ()
817
+ view .message = await self ._parent .original_response ()
765
818
self ._parent ._state .store_view (view )
766
819
767
820
self ._responded = True
768
821
if delete_after is not None :
769
- await self ._parent .delete_original_message (delay = delete_after )
822
+ await self ._parent .delete_original_response (delay = delete_after )
770
823
return self ._parent
771
824
772
825
async def edit_message (
@@ -894,7 +947,7 @@ async def edit_message(
894
947
895
948
self ._responded = True
896
949
if delete_after is not None :
897
- await self ._parent .delete_original_message (delay = delete_after )
950
+ await self ._parent .delete_original_response (delay = delete_after )
898
951
899
952
async def send_autocomplete_result (
900
953
self ,
@@ -1032,7 +1085,7 @@ class InteractionMessage(Message):
1032
1085
"""Represents the original interaction response message.
1033
1086
1034
1087
This allows you to edit or delete the message associated with
1035
- the interaction response. To retrieve this object see :meth:`Interaction.original_message `.
1088
+ the interaction response. To retrieve this object see :meth:`Interaction.original_response `.
1036
1089
1037
1090
This inherits from :class:`discord.Message` with changes to
1038
1091
:meth:`edit` and :meth:`delete` to work.
@@ -1105,7 +1158,7 @@ async def edit(
1105
1158
"""
1106
1159
if attachments is MISSING :
1107
1160
attachments = self .attachments or MISSING
1108
- return await self ._state ._interaction .edit_original_message (
1161
+ return await self ._state ._interaction .edit_original_response (
1109
1162
content = content ,
1110
1163
embeds = embeds ,
1111
1164
embed = embed ,
@@ -1137,7 +1190,7 @@ async def delete(self, *, delay: Optional[float] = None) -> None:
1137
1190
HTTPException
1138
1191
Deleting the message failed.
1139
1192
"""
1140
- await self ._state ._interaction .delete_original_message (delay = delay )
1193
+ await self ._state ._interaction .delete_original_response (delay = delay )
1141
1194
1142
1195
1143
1196
class MessageInteraction :
0 commit comments