From c09acbe9e386768b4c20ac0a634da0b861696e13 Mon Sep 17 00:00:00 2001 From: Corban-Lee Jones Date: Fri, 6 Dec 2024 11:54:32 +0000 Subject: [PATCH] move defer before blacklist check --- cogs/commands.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cogs/commands.py b/cogs/commands.py index c5f6d50..a184b68 100644 --- a/cogs/commands.py +++ b/cogs/commands.py @@ -59,17 +59,13 @@ class CommandCog(commands.Cog): ) async def send_rcon_response(self, inter: Interaction, command: str) -> str: - # if inter.user.id != 377453890523627522: - # log.warning("Bad user tried to send rcon command: '%s', '%s'", inter.user.name, command) - # await inter.response.send_message("Permissions Error", ephemeral=True) - # return + await inter.response.defer() if command in COMMANDS_BLACKLIST: log.warning("Attempt to use banned command: '%s', '%s'", inter.user.name, command) - await inter.response.send_message("Blacklisted command", ephemeral=True) + await inter.followup.send("Blacklisted command") return - await inter.response.defer() response = await rcon(command, **self.bot.rcon_details) await inter.followup.send(content=response)