diff options
| -rw-r--r-- | bot/cogs/modlog.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bot/cogs/modlog.py b/bot/cogs/modlog.py index 9f0c88424..808ba667b 100644 --- a/bot/cogs/modlog.py +++ b/bot/cogs/modlog.py @@ -528,19 +528,22 @@ class ModLog: "\n" ) + if message.attachments: + # Prepend the message metadata with the number of attachments + response = f"**Attachments:** {len(message.attachments)}\n" + response + # Shorten the message content if necessary content = message.clean_content remaining_chars = 2040 - len(response) if len(content) > remaining_chars: - content = content[:remaining_chars] + "..." + botlog_url = await self.upload_log(messages=[message], actor_id=message.author.id) + ending = f"\n\nMessage truncated, [full message here]({botlog_url})." + truncation_point = remaining_chars - len(ending) + content = f"{content[:truncation_point]}...{ending}" response += f"{content}" - if message.attachments: - # Prepend the message metadata with the number of attachments - response = f"**Attachments:** {len(message.attachments)}\n" + response - await self.send_log_message( Icons.message_delete, Colours.soft_red, "Message deleted", |