From 69191b3b9b9e7b793b711fc463966c1956caea41 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 5 Oct 2023 13:58:18 -0400 Subject: [PATCH] fix(moderation): fixed the handle_expiry task setting expired to 1 on moderations without a duration --- moderation/moderation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index b0b497a..a9c8ba2 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -411,7 +411,7 @@ class Moderation(commands.Cog): db = await self.config.mysql_database() guilds: list[discord.Guild] = self.bot.guilds for guild in guilds: - query = f"UPDATE `{db}`.`moderation_{guild.id}` SET expired = 1 WHERE end_timestamp <= %s AND expired = 0" + query = f"UPDATE `{db}`.`moderation_{guild.id}` SET expired = 1 WHERE end_timestamp != 0 AND end_timestamp <= %s AND expired = 0" cursor.execute(query, (time.time(),)) database.commit() cursor.close()