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: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -12,7 +12,6 @@ import time
from datetime import datetime, timedelta, timezone from datetime import datetime, timedelta, timezone
from math import ceil from math import ceil
import aiosqlite
import discord import discord
from discord import Object from discord import Object
from discord.ext import tasks from discord.ext import tasks
@ -1500,11 +1499,7 @@ class Aurora(commands.Cog):
time_per_guild = time.time() 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" 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"
tempbans = await Moderation.execute(bot=self.bot, guild_id=guild.id, query=tempban_query, parameters=(time.time(),))
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 unban_num = 0
for moderation in tempbans: for moderation in tempbans:
@ -1592,7 +1587,7 @@ class Aurora(commands.Cog):
continue continue
addrole_num = 0 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(),)) removeroles = await Moderation.execute(bot=self.bot, guild_id=guild.id, query=removerole_query, parameters=(time.time(),))
for moderation in removeroles: for moderation in removeroles: