Browse Source

[commands] Use interaction response within Context.send

pull/10107/head
Rapptz 2 months ago
parent
commit
776fc2251d
  1. 7
      discord/ext/commands/context.py

7
discord/ext/commands/context.py

@ -1078,8 +1078,11 @@ class Context(discord.abc.Messageable, Generic[BotT]):
if self.interaction.response.is_done(): if self.interaction.response.is_done():
msg = await self.interaction.followup.send(**kwargs, wait=True) msg = await self.interaction.followup.send(**kwargs, wait=True)
else: else:
await self.interaction.response.send_message(**kwargs) response = await self.interaction.response.send_message(**kwargs)
msg = await self.interaction.original_response() if not isinstance(response.resource, discord.InteractionMessage):
msg = await self.interaction.original_response()
else:
msg = response.resource
if delete_after is not None: if delete_after is not None:
await msg.delete(delay=delete_after) await msg.delete(delay=delete_after)

Loading…
Cancel
Save