From 2d12fc82a4bcfe37c711cc0f42c8a3e871663907 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Tue, 19 Nov 2024 19:52:19 +0100 Subject: [PATCH] use correct indices for streak expiration lookup --- src/cogs/streak.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cogs/streak.py b/src/cogs/streak.py index fbd8edd..4afe959 100644 --- a/src/cogs/streak.py +++ b/src/cogs/streak.py @@ -156,14 +156,15 @@ class Streak(commands.Cog): streaks = self.cursor.fetchall() for streak in streaks: - if (datetime.now(timezone.utc) - streak[2]).days >= 1: - self.cache.pop(streak[1]) + if (datetime.now(timezone.utc) - streak[1]).days >= 1: + self.bot.logger.info(f"User {streak[0]} lost their streak") + self.streak_cache.pop(streak[0]) self.cursor.execute( """ DELETE FROM streak WHERE discord_id = %s; """, - (streak[1],), + (streak[0],), ) @streak_check.after_loop