fix(aurora): removed a useless try/except block

This commit is contained in:
Seaswimmer 2024-06-05 01:36:45 -04:00
parent e988917319
commit afac274978
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -12,7 +12,6 @@ import time
from datetime import datetime, timedelta, timezone
from math import ceil
import aiosqlite
import discord
from discord import Object
from discord.ext import tasks
@ -1500,11 +1499,7 @@ class Aurora(commands.Cog):
time_per_guild = time.time()
tempban_query = f"SELECT * FROM moderation_{guild.id} WHERE end_timestamp IS NOT NULL 0 AND end_timestamp <= ? AND moderation_type = 'TEMPBAN' AND expired = 0"
try:
tempbans = await Moderation.execute(bot=self.bot, guild_id=guild.id, query=tempban_query, parameters=(time.time(),))
except aiosqlite.OperationalError:
continue
unban_num = 0
for moderation in tempbans:
@ -1592,7 +1587,7 @@ class Aurora(commands.Cog):
continue
addrole_num = 0
removerole_query = f"SELECT target_id, moderation_id, role_id FROM moderation_{guild.id} WHERE end_timestamp IS NOT NULL 0 AND end_timestamp <= ? AND moderation_type = 'REMOVEROLE' AND expired = 0"
removerole_query = f"SELECT * FROM moderation_{guild.id} WHERE end_timestamp IS NOT NULL 0 AND end_timestamp <= ? AND moderation_type = 'REMOVEROLE' AND expired = 0"
removeroles = await Moderation.execute(bot=self.bot, guild_id=guild.id, query=removerole_query, parameters=(time.time(),))
for moderation in removeroles: