From 25c30e286cdea641d30456b8301730d761b15e02 Mon Sep 17 00:00:00 2001 From: Ali Aljishi Date: Fri, 13 Dec 2024 21:43:07 +0000 Subject: [PATCH] counting restarts when error occurs --- cogs/commands/counting.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cogs/commands/counting.py b/cogs/commands/counting.py index 5a5b589..28f8e56 100644 --- a/cogs/commands/counting.py +++ b/cogs/commands/counting.py @@ -66,7 +66,7 @@ def check_dec(m): # Used to make sure someone else replies last_player = msg.author - while True: + while self.currently_playing: # Wait for the next numeric message sent by a different person in the same channel def check_dec_player(m): return check_dec(m) and m.author != last_player @@ -205,8 +205,11 @@ async def me(self, ctx: Context): @user.error async def user_error(self, ctx: Context, err): + self.currently_playing = False await ctx.send(err) - + @counting.error + async def counting_error(self, ctx: Context, err): + self.currently_playing = False async def setup(bot: Bot): await bot.add_cog(Counting(bot))