From 776fc2251dd2ce1652dffe85f134d7937371e5ab Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 18 Feb 2025 02:21:45 -0500 Subject: [PATCH] [commands] Use interaction response within Context.send --- discord/ext/commands/context.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index 5a74fa5f3..fa89b5078 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -1078,8 +1078,11 @@ class Context(discord.abc.Messageable, Generic[BotT]): if self.interaction.response.is_done(): msg = await self.interaction.followup.send(**kwargs, wait=True) else: - await self.interaction.response.send_message(**kwargs) - msg = await self.interaction.original_response() + response = await self.interaction.response.send_message(**kwargs) + if not isinstance(response.resource, discord.InteractionMessage): + msg = await self.interaction.original_response() + else: + msg = response.resource if delete_after is not None: await msg.delete(delay=delete_after)