use correct indices for streak expiration lookup

This commit is contained in:
leander committed 2024-11-19 19:52:19 +01:00
1 parent 619683b0e3
commit 2d12fc82a4
1 file changed
+4 -3
+4 -3
View File
@@ -156,14 +156,15 @@ class Streak(commands.Cog):
streaks = self.cursor.fetchall() streaks = self.cursor.fetchall()
for streak in streaks: for streak in streaks:
if (datetime.now(timezone.utc) - streak[2]).days >= 1: if (datetime.now(timezone.utc) - streak[1]).days >= 1:
self.cache.pop(streak[1]) self.bot.logger.info(f"User {streak[0]} lost their streak")
self.streak_cache.pop(streak[0])
self.cursor.execute( self.cursor.execute(
""" """
DELETE FROM streak DELETE FROM streak
WHERE discord_id = %s; WHERE discord_id = %s;
""", """,
(streak[1],), (streak[0],),
) )
@streak_check.after_loop @streak_check.after_loop