mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
[commands] Handle nick mentions in HelpFormatter
Modifies the help formatter to handle nicknamed bot users for mentions in clean_prefix
This commit is contained in:
parent
1436af3b18
commit
39cb5f30b4
@ -181,12 +181,12 @@ class HelpFormatter:
|
||||
@property
|
||||
def clean_prefix(self):
|
||||
"""The cleaned up invoke prefix. i.e. mentions are ``@name`` instead of ``<@id>``."""
|
||||
user = self.context.bot.user
|
||||
user = self.context.guild.me if self.context.guild else self.context.bot.user
|
||||
# this breaks if the prefix mention is not the bot itself but I
|
||||
# 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.name)
|
||||
return self.context.prefix.replace(user.mention, '@' + user.display_name)
|
||||
|
||||
def get_command_signature(self):
|
||||
"""Retrieves the signature portion of the help page."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user