fix(moderation): pylint fixes
All checks were successful
Pylint / Pylint (push) Successful in 1m15s

This commit is contained in:
Seaswimmer 2023-10-06 09:04:02 -04:00
parent 4960d40ac9
commit 5fa62fceca
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -420,13 +420,13 @@ class Moderation(commands.Cog):
try:
member = await interaction.guild.fetch_member(case['target_id'])
await member.timeout(None, reason=f"Case #{case_number} resolved by {interaction.user.id}")
except:
except discord.NotFound:
pass
if case['moderation_type'] == 'tempban':
try:
user = await interaction.client.fetch_user(case['target_id'])
await interaction.guild.unban(user, reason=f"Case #{case_number} resolved by {interaction.user.id}")
except:
except discord.NotFound:
pass
resolve_query = f"UPDATE moderation_{interaction.guild.id} SET resolved = 1, expired = 1, resolve_reason = %s WHERE moderation_id = %s"
else:
@ -445,19 +445,7 @@ class Moderation(commands.Cog):
cursor.close()
database.close()
if result:
case = {
"moderation_id": result[0],
"timestamp": result[1],
"moderation_type": result[2],
"target_id": result[3],
"moderator_id": result[4],
"duration": result[5],
"end_timestamp": result[6],
"reason": result[7],
"resolved": result[8],
"resolve_reason": result[9],
"expired": result[10]
}
case = self.generate_dict(result)
try:
target = await interaction.client.fetch_user(case["target_id"])
target_user = {