From 3cb4625d7dc105c02e23aa01e718305ecbeaeab6 Mon Sep 17 00:00:00 2001 From: FrozenChen Date: Sat, 6 Jan 2024 15:23:46 -0300 Subject: [PATCH] events.py: Fix messages being too long for non approved invites --- cogs/events.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogs/events.py b/cogs/events.py index 50ab2551..156f3780 100644 --- a/cogs/events.py +++ b/cogs/events.py @@ -110,6 +110,8 @@ async def scan_message(self, message: discord.Message, is_edit=False): text = self.bot.escape_text(message.content) for code in non_approved_invites: text = text.replace(code, f"`{code}`") + if len(text) > 1600: + text = f"Non approved invites: {', '.join(non_approved_invites)} (Message not shown due to length)" await self.bot.channels['message-logs'].send( f"✉️ **Invite posted**: {message.author.mention} posted an invite link in {message.channel.mention}" f" {'(message deleted)' if non_approved_invites else ''}"