From 6cdda4a320c0aeabccd5837402527009075ed173 Mon Sep 17 00:00:00 2001 From: Michael H Date: Thu, 2 Jan 2020 16:50:12 -0500 Subject: [PATCH] Patch clean_prefix for new text editor The new editor seems to force mentions to have ! even without a nick. --- discord/ext/commands/help.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py index db066a361..ad8bd4e2c 100644 --- a/discord/ext/commands/help.py +++ b/discord/ext/commands/help.py @@ -344,7 +344,8 @@ class HelpCommand: # consider this to be an *incredibly* strange use case. I'd rather go # for this common use case rather than waste performance for the # odd one. - return self.context.prefix.replace(user.mention, '@' + user.display_name) + pattern = re.compile(r"<@!?%s>" % user.id) + return pattern.sub("@%s" % user.display_name, self.context.prefix) @property def invoked_with(self):