aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar scragly <[email protected]>2018-11-17 14:32:29 +1000
committerGravatar scragly <[email protected]>2018-11-17 14:32:29 +1000
commit96cb3f033486a8bc04c952b28ef00f13561688ee (patch)
treef120d137098fac1906033e477737ad320557a9e3
parentMerge branch 'infraction-notifs' into 'master' (diff)
Add aliases, prefix to cmd sig, remove from subcommands
-rw-r--r--bot/cogs/help.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/bot/cogs/help.py b/bot/cogs/help.py
index 144286c56..d30ff0dfb 100644
--- a/bot/cogs/help.py
+++ b/bot/cogs/help.py
@@ -355,10 +355,18 @@ class HelpSession:
# Use LinePaginator to restrict embed line height
paginator = LinePaginator(prefix='', suffix='', max_lines=self._max_lines)
+ prefix = constants.Bot.prefix
+
# show signature if query is a command
if isinstance(self.query, commands.Command):
signature = self._get_command_params(self.query)
- paginator.add_line(f'**```{signature}```**')
+ parent = self.query.full_parent_name + ' ' if self.query.parent else ''
+ paginator.add_line(f'**```{prefix}{parent}{signature}```**')
+
+ # show command aliases
+ aliases = ', '.join(f'`{a}`' for a in self.query.aliases)
+ if aliases:
+ paginator.add_line(f'**Can also use:** {aliases}\n')
if not await self.query.can_run(self._ctx):
paginator.add_line('***You cannot run this command.***\n')
@@ -392,6 +400,9 @@ class HelpSession:
elif isinstance(self.query, commands.Command):
grouped = (('**Subcommands:**', self.query.commands),)
+ # don't show prefix for subcommands
+ prefix = ''
+
# otherwise sort and organise all commands into categories
else:
cat_sort = sorted(filtered, key=self._category_key)
@@ -424,7 +435,6 @@ class HelpSession:
strikeout = '~~'
signature = self._get_command_params(command)
- prefix = constants.Bot.prefix
info = f"{strikeout}**`{prefix}{signature}`**{strikeout}"
# handle if the command has no docstring