mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Allow SimpleMenu to delete ephemeral responses (#6304)
This commit is contained in:
parent
bf8c0d03b5
commit
601816abc0
@ -66,8 +66,9 @@ class _StopButton(discord.ui.Button):
|
|||||||
async def callback(self, interaction: discord.Interaction):
|
async def callback(self, interaction: discord.Interaction):
|
||||||
self.view.stop()
|
self.view.stop()
|
||||||
if interaction.message.flags.ephemeral:
|
if interaction.message.flags.ephemeral:
|
||||||
await interaction.response.edit_message(view=None)
|
await interaction.response.defer(thinking=False)
|
||||||
return
|
await interaction.delete_original_response()
|
||||||
|
else:
|
||||||
await interaction.message.delete()
|
await interaction.message.delete()
|
||||||
|
|
||||||
|
|
||||||
@ -208,7 +209,7 @@ class SimpleMenu(discord.ui.View):
|
|||||||
|
|
||||||
async def on_timeout(self):
|
async def on_timeout(self):
|
||||||
try:
|
try:
|
||||||
if self.delete_after_timeout and not self.message.flags.ephemeral:
|
if self.delete_after_timeout:
|
||||||
await self.message.delete()
|
await self.message.delete()
|
||||||
elif self.disable_after_timeout:
|
elif self.disable_after_timeout:
|
||||||
for child in self.children:
|
for child in self.children:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user