fix(moderation): fixed handle_expiry task
Some checks failed
Pylint / Pylint (push) Failing after 1m11s
Some checks failed
Pylint / Pylint (push) Failing after 1m11s
This commit is contained in:
parent
a8ea15a5c6
commit
8d9b934fee
1 changed files with 5 additions and 2 deletions
|
@ -408,7 +408,10 @@ class Moderation(commands.Cog):
|
||||||
return
|
return
|
||||||
database = await self.connect()
|
database = await self.connect()
|
||||||
cursor = database.cursor()
|
cursor = database.cursor()
|
||||||
query = f"UPDATE {await self.config.mysql_database()}.* SET expired = 1 WHERE end_timestamp <= %s AND expired = 0"
|
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"
|
||||||
cursor.execute(query, (time.time(),))
|
cursor.execute(query, (time.time(),))
|
||||||
database.commit()
|
database.commit()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
Loading…
Reference in a new issue