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 = {