fix(moderation): resolved moderations with a duration will now be considered "expired"
Some checks failed
Pylint / Pylint (push) Failing after 1m12s

This commit is contained in:
Seaswimmer 2023-10-05 14:14:05 -04:00
parent 69191b3b9b
commit ce72d0c6bf
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -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 != 0 AND 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) OR resolved = 1"
cursor.execute(query, (time.time(),))
database.commit()
cursor.close()