from disnake.ext import commands
import disnake
class CooldownCog(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.Cog.listener(name="on_slash_command_error")
async def slash_command_on_cooldown(self,
inter: disnake.ApplicationCommandInteraction,
error: commands.CommandError):
if isinstance(error, commands.CommandOnCooldown):
# await inter.delete_original_response()
await inter.send(str(error))
def setup(bot: commands.Bot):
bot.add_cog(CooldownCog(bot))
I have this code to respond to a user if a command is in cooldown. It is guaranteed that there was an inter.response.defer() before it, but unknown ephemeral. I need to get a boolean ephemeral to modify or delete and send the response.