fix(moderation): fixed the handle_expiry task setting expired to 1 on moderations without a duration
Some checks failed
Pylint / Pylint (push) Failing after 1m12s
Some checks failed
Pylint / Pylint (push) Failing after 1m12s
This commit is contained in:
parent
8d9b934fee
commit
69191b3b9b
1 changed files with 1 additions and 1 deletions
|
@ -411,7 +411,7 @@ class Moderation(commands.Cog):
|
||||||
db = await self.config.mysql_database()
|
db = await self.config.mysql_database()
|
||||||
guilds: list[discord.Guild] = self.bot.guilds
|
guilds: list[discord.Guild] = self.bot.guilds
|
||||||
for guild in 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(),))
|
cursor.execute(query, (time.time(),))
|
||||||
database.commit()
|
database.commit()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
Loading…
Reference in a new issue