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
All checks were successful
Pylint / Pylint (push) Successful in 1m12s
This commit is contained in:
parent
6001c926f2
commit
0c004ecf48
1 changed files with 2 additions and 2 deletions
|
@ -364,7 +364,7 @@ class Moderation(commands.Cog):
|
||||||
cursor.execute(query_1, (interaction.guild.id, case_number))
|
cursor.execute(query_1, (interaction.guild.id, case_number))
|
||||||
result_1 = cursor.fetchone()
|
result_1 = cursor.fetchone()
|
||||||
if result_1 is None:
|
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
|
return
|
||||||
query_2 = "SELECT * FROM moderation_%s WHERE moderation_id = %s AND resolved = 0;"
|
query_2 = "SELECT * FROM moderation_%s WHERE moderation_id = %s AND resolved = 0;"
|
||||||
cursor.execute(query_2, (interaction.guild.id, case_number))
|
cursor.execute(query_2, (interaction.guild.id, case_number))
|
||||||
|
@ -455,7 +455,7 @@ class Moderation(commands.Cog):
|
||||||
db = await self.config.mysql_database()
|
db = await self.config.mysql_database()
|
||||||
guilds: list[discord.Guild] = self.bot.guilds
|
guilds: list[discord.Guild] = self.bot.guilds
|
||||||
for guild in 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(),))
|
cursor.execute(tempban_query, (time.time(),))
|
||||||
result = cursor.fetchall()
|
result = cursor.fetchall()
|
||||||
target_ids = [row[0] for row in result]
|
target_ids = [row[0] for row in result]
|
||||||
|
|
Loading…
Reference in a new issue