From 7653e386aae7d79ebe00e8dcc2e658e3e9652a0d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2023 19:34:01 +0100 Subject: [PATCH] Trying to fix this myself --- recruitmentCog/recruitment.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/recruitmentCog/recruitment.py b/recruitmentCog/recruitment.py index be25cbd..ef13af6 100644 --- a/recruitmentCog/recruitment.py +++ b/recruitmentCog/recruitment.py @@ -29,14 +29,17 @@ class Recruitment(commands.Cog): self.antispam = {} async def cog_check(self, ctx: commands.Context): - if ctx.guild.id not in self.antispam: - self.antispam[ctx.guild.id] = AntiSpam([(5, 5), (30, 10), (300, 20)]) + guild_id = ctx.guild.id + if guild_id not in self.antispam: + self.antispam[guild_id] = AntiSpam([(5, 5), (30, 10), (300, 20)]) - if self.antispam[ctx.guild.id].spammy(ctx=ctx): + antispam = self.antispam[guild_id] + if antispam.spammy(ctx): return False return True + @commands.guild_only() @checks.admin_or_permissions(manage_guild=True) @commands.group(name="setapplicationschannel", pass_context=True, no_pm=True)