Fix deletion area of keys to prevent false positives
This commit is contained in:
parent
1c30e27ec9
commit
e1efb7be55
1 changed files with 3 additions and 3 deletions
|
@ -659,6 +659,7 @@ class Jarvis(Client):
|
||||||
return
|
return
|
||||||
|
|
||||||
user_key = f"msg|{context.message.id}"
|
user_key = f"msg|{context.message.id}"
|
||||||
|
action_key = ""
|
||||||
|
|
||||||
if context.custom_id == "modcase|yes":
|
if context.custom_id == "modcase|yes":
|
||||||
if user_id := await self.redis.get(user_key):
|
if user_id := await self.redis.get(user_key):
|
||||||
|
@ -698,12 +699,11 @@ class Jarvis(Client):
|
||||||
self.logger.warn("Unable to get action data ( %s )", action_key)
|
self.logger.warn("Unable to get action data ( %s )", action_key)
|
||||||
await context.send("Unable to get action data", ephemeral=True)
|
await context.send("Unable to get action data", ephemeral=True)
|
||||||
|
|
||||||
await self.bot.redis.delete(user_key)
|
|
||||||
await self.bot.redis.delete(action_key)
|
|
||||||
|
|
||||||
for row in context.message.components:
|
for row in context.message.components:
|
||||||
for component in row.components:
|
for component in row.components:
|
||||||
component.disabled = True
|
component.disabled = True
|
||||||
await context.message.edit(components=context.message.components)
|
await context.message.edit(components=context.message.components)
|
||||||
msg = "Cancelled" if context.custom_id == "modcase|no" else "Moderation case opened"
|
msg = "Cancelled" if context.custom_id == "modcase|no" else "Moderation case opened"
|
||||||
await context.send(msg)
|
await context.send(msg)
|
||||||
|
await self.bot.redis.delete(user_key)
|
||||||
|
await self.bot.redis.delete(action_key)
|
||||||
|
|
Loading…
Add table
Reference in a new issue