fix(moderation): expire_handler now checks for the expired bool instead of the resolved bool
All checks were successful
Pylint / Pylint (push) Successful in 1m12s

This commit is contained in:
Seaswimmer 2023-10-05 17:14:04 -04:00
parent 6001c926f2
commit 0c004ecf48
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -364,7 +364,7 @@ class Moderation(commands.Cog):
cursor.execute(query_1, (interaction.guild.id, case_number))
result_1 = cursor.fetchone()
if result_1 is None:
await interaction.response.send_message(content=f"There is no moderation with a case number of {case_number}!", ephemeral=True)
await interaction.response.send_message(content=f"There is no moderation with a case number of {case_number}.", ephemeral=True)
return
query_2 = "SELECT * FROM moderation_%s WHERE moderation_id = %s AND resolved = 0;"
cursor.execute(query_2, (interaction.guild.id, case_number))
@ -455,7 +455,7 @@ class Moderation(commands.Cog):
db = await self.config.mysql_database()
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 resolved = 0"
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()
target_ids = [row[0] for row in result]