aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-07-20 11:55:45 -0700
committerGravatar MarkKoz <[email protected]>2020-07-21 10:30:31 -0700
commit830e231b681315b74480a312111e5cabc5ca2167 (patch)
tree24aedb986115821744dc65acabdc346dbdd92b52
parentSuperstarify: use user mentions in mod logs (diff)
Superstarify: escape Markdown in nicknames
-rw-r--r--bot/cogs/moderation/superstarify.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/cogs/moderation/superstarify.py b/bot/cogs/moderation/superstarify.py
index f22e7e741..b23588b1c 100644
--- a/bot/cogs/moderation/superstarify.py
+++ b/bot/cogs/moderation/superstarify.py
@@ -7,6 +7,7 @@ from pathlib import Path
from discord import Colour, Embed, Member
from discord.ext.commands import Cog, Context, command
+from discord.utils import escape_markdown
from bot import constants
from bot.bot import Bot
@@ -139,7 +140,6 @@ class Superstarify(InfractionScheduler, Cog):
infraction = await utils.post_infraction(ctx, member, "superstar", reason, duration, active=True)
id_ = infraction["id"]
- old_nick = member.display_name
forced_nick = self.get_nick(id_, member.id)
expiry_str = format_infraction(infraction["expires_at"])
@@ -149,6 +149,9 @@ class Superstarify(InfractionScheduler, Cog):
await member.edit(nick=forced_nick, reason=reason)
self.schedule_expiration(infraction)
+ old_nick = escape_markdown(member.display_name)
+ forced_nick = escape_markdown(forced_nick)
+
# Send a DM to the user to notify them of their new infraction.
await utils.notify_infraction(
user=member,