move defer before blacklist check
All checks were successful
Build and Push Docker Image / build (push) Successful in 22s

This commit is contained in:
Corban-Lee Jones 2024-12-06 11:54:32 +00:00
parent 82d2eb6ed2
commit c09acbe9e3

View File

@ -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)