Skip to content

Commit

Permalink
events.py: Fix messages being too long for non approved invites
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenChen committed Jan 6, 2024
1 parent 084a712 commit 3cb4625
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''}"
Expand Down

0 comments on commit 3cb4625

Please sign in to comment.