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: try:
member = await interaction.guild.fetch_member(case['target_id']) member = await interaction.guild.fetch_member(case['target_id'])
await member.timeout(None, reason=f"Case #{case_number} resolved by {interaction.user.id}") await member.timeout(None, reason=f"Case #{case_number} resolved by {interaction.user.id}")
except: except discord.NotFound:
pass pass
if case['moderation_type'] == 'tempban': if case['moderation_type'] == 'tempban':
try: try:
user = await interaction.client.fetch_user(case['target_id']) user = await interaction.client.fetch_user(case['target_id'])
await interaction.guild.unban(user, reason=f"Case #{case_number} resolved by {interaction.user.id}") await interaction.guild.unban(user, reason=f"Case #{case_number} resolved by {interaction.user.id}")
except: except discord.NotFound:
pass pass
resolve_query = f"UPDATE moderation_{interaction.guild.id} SET resolved = 1, expired = 1, resolve_reason = %s WHERE moderation_id = %s" resolve_query = f"UPDATE moderation_{interaction.guild.id} SET resolved = 1, expired = 1, resolve_reason = %s WHERE moderation_id = %s"
else: else:
@ -445,19 +445,7 @@ class Moderation(commands.Cog):
cursor.close() cursor.close()
database.close() database.close()
if result: if result:
case = { case = self.generate_dict(result)
"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]
}
try: try:
target = await interaction.client.fetch_user(case["target_id"]) target = await interaction.client.fetch_user(case["target_id"])
target_user = { target_user = {