From 5fa62fceca8335bb5ad8b9e51b1a291bf7073580 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 6 Oct 2023 09:04:02 -0400 Subject: [PATCH] fix(moderation): pylint fixes --- moderation/moderation.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index d0f2516..a37186a 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -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 = {