diff --git a/moderation/moderation.py b/moderation/moderation.py index 7e51cd3..a78caf4 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -439,6 +439,27 @@ class Moderation(commands.Cog): return embed + if embed_type == 'changes': + embed = discord.Embed(title=f"📕 Case #{case_dict['moderation_id']} Changes", color=await self.bot.get_embed_color(None)) + + memory_dict = {} + + if case_dict['changes']: + for change in case_dict['changes']: + if change['user_id'] not in memory_dict: + memory_dict[str(change['user_id'])] = await self.fetch_user_dict(interaction, change['user_id']) + user = memory_dict[str(change['user_id'])] + name = user['name'] if user['discriminator'] == "0" else f"{user['name']}#{user['discriminator']}" + timestamp = f" | " + if change['type'] == 'ORIGINAL': + embed.add_field(name='Original', value=f"**User:** `{name}` ({user['id']})\n**Reason:** {change['reason']}\n**Timestamp:** {timestamp}", inline=False) + elif change['type'] == 'EDIT': + embed.add_field(name='Edit', value=f"**User:** `{name}` ({user['id']})\n**Reason:** {change['reason']}\n**Timestamp:** {timestamp}", inline=False) + elif change['type'] == 'RESOLVE': + embed.add_field(name='Resolve', value=f"**User:** `{name}` ({user['id']})\n**Reason:** {change['reason']}\n**Timestamp:** {timestamp}", inline=False) + + return embed + if embed_type == 'log': if resolved: target_user = await self.fetch_user_dict(interaction, case_dict['target_id'])