diff --git a/moderation/moderation.py b/moderation/moderation.py index d7ea538..a9ee9df 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -523,8 +523,11 @@ class Moderation(commands.Cog): guilds: list[discord.Guild] = self.bot.guilds for guild in guilds: tempban_query = f"SELECT target_id, moderation_id FROM moderation_{guild.id} WHERE end_timestamp != 0 AND end_timestamp <= %s AND moderation_type = 'TEMPBAN' AND expired = 0" - cursor.execute(tempban_query, (time.time(),)) - result = cursor.fetchall() + try: + cursor.execute(tempban_query, (time.time(),)) + result = cursor.fetchall() + except mysql.connector.errors.ProgrammingError: + continue target_ids = [row[0] for row in result] moderation_ids = [row[1] for row in result] for target_id, moderation_id in zip(target_ids, moderation_ids):