diff --git a/moderation/moderation.py b/moderation/moderation.py index 6b333cf..b0b497a 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -408,8 +408,11 @@ class Moderation(commands.Cog): return database = await self.connect() cursor = database.cursor() - query = f"UPDATE {await self.config.mysql_database()}.* SET expired = 1 WHERE end_timestamp <= %s AND expired = 0" - cursor.execute(query, (time.time(),)) + 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(),)) database.commit() cursor.close() database.close()