From 79276da17eeb5e96f3b9f2732e32ddf859f858f2 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Wed, 6 May 2020 23:57:57 +0200 Subject: [PATCH] Escape backslashes in display name in `clean_prefix` --- discord/ext/commands/help.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py index 72992de9e..226e5f6a5 100644 --- a/discord/ext/commands/help.py +++ b/discord/ext/commands/help.py @@ -345,7 +345,7 @@ class HelpCommand: # for this common use case rather than waste performance for the # odd one. pattern = re.compile(r"<@!?%s>" % user.id) - return pattern.sub("@%s" % user.display_name, self.context.prefix) + return pattern.sub("@%s" % user.display_name.replace('\\', r'\\'), self.context.prefix) @property def invoked_with(self):