[commands] Fix Context.reply not working with expired interactions

This commit is contained in:
Rapptz 2022-04-19 22:09:33 -04:00
parent 19fb8ac447
commit cd0d6749ea

View File

@ -541,7 +541,10 @@ class Context(discord.abc.Messageable, Generic[BotT]):
:class:`~discord.Message`
The message that was sent.
"""
return await self.send(content, reference=self.message, **kwargs)
if self.interaction is None:
return await self.send(content, reference=self.message, **kwargs)
else:
return await self.send(content, **kwargs)
async def defer(self, *, ephemeral: bool = False) -> None:
"""|coro|