From 751fb7f043238ff0ec2ddfc04539fbf426d5d15b Mon Sep 17 00:00:00 2001 From: Slipstream Date: Fri, 6 Jun 2025 15:51:24 +0000 Subject: [PATCH 1/2] Applying previous commit. --- cogs/logging_cog.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cogs/logging_cog.py b/cogs/logging_cog.py index 814ae83..bf60d9a 100644 --- a/cogs/logging_cog.py +++ b/cogs/logging_cog.py @@ -1160,6 +1160,16 @@ class LoggingCog(commands.Cog): ), inline=False, ) + if before.content: + before_text = before.content[:1020] + ( + "..." if len(before.content) > 1020 else "" + ) + embed.add_field(name="Before", value=before_text or "`Empty`", inline=False) + if after.content: + after_text = after.content[:1020] + ( + "..." if len(after.content) > 1020 else "" + ) + embed.add_field(name="After", value=after_text or "`Empty`", inline=False) self._add_id_footer(embed, after, id_name="Message ID") # Add message ID await self._send_log_embed(guild, embed) @@ -1780,7 +1790,7 @@ class LoggingCog(commands.Cog): added = [r.mention for r in after_roles if r not in before_roles] removed = [r.mention for r in before_roles if r not in after_roles] if added or removed: # Only log if roles actually changed - action_desc = f"{self._user_display(user)} updated roles for {self._user_display(target)} ({target.id}):" + action_desc = f"{self._user_display(user)} updated roles for {self._user_display(target)}:" if added: action_desc += f"\n**Added:** {', '.join(added)}" if removed: From af432da94d90ac5db4fdcfb864877de65fdfac11 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 6 Jun 2025 15:53:30 +0000 Subject: [PATCH 2/2] Fix audit log messages and add content --- cogs/logging_cog.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/logging_cog.py b/cogs/logging_cog.py index bf60d9a..d952532 100644 --- a/cogs/logging_cog.py +++ b/cogs/logging_cog.py @@ -1812,10 +1812,10 @@ class LoggingCog(commands.Cog): timeout_duration = discord.utils.format_dt( after_timed_out, style="R" ) - action_desc = f"{self._user_display(user)} timed out {self._user_display(target)} ({target.id}) until {timeout_duration}" + action_desc = f"{self._user_display(user)} timed out {self._user_display(target)} until {timeout_duration}" color = discord.Color.orange() else: - action_desc = f"{self._user_display(user)} removed timeout from {self._user_display(target)} ({target.id})" + action_desc = f"{self._user_display(user)} removed timeout from {self._user_display(target)}" color = discord.Color.green() # self._add_id_footer(embed, target, id_name="Target ID") # Footer set later else: @@ -2134,7 +2134,7 @@ class LoggingCog(commands.Cog): title = "🛡️ Audit Log: Message Deleted" # Title adjusted for clarity channel = entry.extra.channel count = entry.extra.count - action_desc = f"{user.mention} deleted {count} message(s) by {target.mention} ({target.id}) in {channel.mention}" + action_desc = f"{user.mention} deleted {count} message(s) by {self._user_display(target)} in {channel.mention}" color = discord.Color.dark_grey() elif entry.action == discord.AuditLogAction.message_bulk_delete: