aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjack1142 <[email protected]>2020-05-06 23:57:57 +0200
committerRapptz <[email protected]>2020-05-07 02:30:24 -0400
commit79276da17eeb5e96f3b9f2732e32ddf859f858f2 (patch)
tree10b31e02e8771eb7928edd0562d00e4ba5786d21
parent[tasks] Fix tasks decorators being discarded (diff)
downloaddiscord.py-79276da17eeb5e96f3b9f2732e32ddf859f858f2.tar.xz
discord.py-79276da17eeb5e96f3b9f2732e32ddf859f858f2.zip
Escape backslashes in display name in `clean_prefix`
-rw-r--r--discord/ext/commands/help.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py
index 72992de9..226e5f6a 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):