[Mod] Prevent invite links from embedding in modlog (#2110)

This commit is contained in:
Twentysix
2018-09-11 19:33:38 +02:00
committed by GitHub
parent c7becb6d80
commit 7cd3ff13bf

View File

@@ -1465,6 +1465,11 @@ class Mod:
channel = self.bot.get_channel(channel) channel = self.bot.get_channel(channel)
tmp["action"] += ' in ' + channel.mention tmp["action"] += ' in ' + channel.mention
contains_invite = any(("discord.gg/" in tmp["user"].lower(),
"discordapp.com/" in tmp["user"].lower()))
if contains_invite:
tmp["user"] = tmp["user"].replace(".", "\u200b.")
case_msg = ( case_msg = (
"**Case #{case}** | {action}\n" "**Case #{case}** | {action}\n"
"**User:** {user} ({user_id})\n" "**User:** {user} ({user_id})\n"