From d0a9404cb0cfee64bf26df5ec7cce2ea71cb4f15 Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Thu, 9 Apr 2020 18:02:30 +0200 Subject: Delete channel from claimant cache. Deleting the channel from the claimant cache on invokation of the dormant command prevents users running the command multiple times before the bot moves it. --- bot/cogs/help_channels.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 69812eda0..346d35aa8 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -210,6 +210,9 @@ class HelpChannels(Scheduler, commands.Cog): log.trace("dormant command invoked; checking if the channel is in-use.") if ctx.channel.category == self.in_use_category: if await self.dormant_check(ctx): + with suppress(KeyError): + del self.help_channel_claimants[ctx.channel] + with suppress(discord.errors.NotFound): log.trace("Deleting dormant invokation message.") await ctx.message.delete() -- cgit v1.2.3