From 0d330d7470a97660e91280979d064983f7716ecf Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sun, 3 Jan 2021 11:21:13 -0800 Subject: HelpChannels: prevent user from claiming multiple channels quickly It's conceivable for a user to be able to quickly send a message in all available channels before the code has a chance to add the cooldown role. Place a lock on the author to prevent the claim code from running multiple times for the same user. --- bot/exts/help_channels/_cog.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py index a9ca01cdd..5695d0d05 100644 --- a/bot/exts/help_channels/_cog.py +++ b/bot/exts/help_channels/_cog.py @@ -89,6 +89,7 @@ class HelpChannels(commands.Cog): self.scheduler.cancel_all() @lock.lock_arg(NAMESPACE, "message", attrgetter("channel.id")) + @lock.lock_arg(NAMESPACE, "message", attrgetter("author.id")) async def claim_channel(self, message: discord.Message) -> None: """ Claim the channel in which the question `message` was sent. -- cgit v1.2.3