Skip to content

Commit

Permalink
rules.py: Fix invite embeds for real this time
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenChen committed Nov 23, 2023
1 parent 1269c46 commit 04675fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cogs/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ async def scan_message(self, message: discord.Message, is_edit=False):
await self.bot.channels['upload-logs'].send(f"📎 **Attachment**: {message.author.mention} "
f"uploaded to {message.channel.mention}", embed=embed2)
if contains_invite_link:
text = message.content
text = self.bot.escape_text(message.content)
for code in non_approved_invites:
text.replace(code, f"`{code}`")
text = text.replace(code, f"`{code}`")
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 ''}"
f"\n------------------\n"
f"{self.bot.escape_text(text)}", suppress_embeds=any(non_approved_invites))
f"{text}", suppress_embeds=any(non_approved_invites))
if non_approved_invites:
try:
await message.delete()
Expand Down Expand Up @@ -420,7 +420,7 @@ async def on_message(self, message: discord.Message):
await self.bot.close()
return
await self.bot.wait_until_all_ready()
if message.author == message.guild.me or check_staff(self.bot, 'Helper', message.author.id) \
if message.author == message.guild.me\
or message.channel.id in self.bot.configuration.nofilter_list:
return
await self.scan_message(message)
Expand Down

0 comments on commit 04675fa

Please sign in to comment.