diff options
| author | jack1142 <[email protected]> | 2021-03-24 13:16:23 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-24 08:16:23 -0400 |
| commit | caa3b4e8f4cf016cad5bb4cc17d689cfe7cd173e (patch) | |
| tree | 2da18dd30e1c198be74139ab02e10c980129d48b | |
| parent | [docs] Grammar fixes for intents.rst (diff) | |
| download | discord.py-caa3b4e8f4cf016cad5bb4cc17d689cfe7cd173e.tar.xz discord.py-caa3b4e8f4cf016cad5bb4cc17d689cfe7cd173e.zip | |
[commands] Include group args in command signature
| -rw-r--r-- | discord/ext/commands/help.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py index e8606f8f..7791f75a 100644 --- a/discord/ext/commands/help.py +++ b/discord/ext/commands/help.py @@ -437,15 +437,24 @@ class HelpCommand: The signature for the command. """ - parent = command.full_parent_name + parent = command.parent + entries = [] + while parent is not None: + if not parent.signature or parent.invoke_without_command: + entries.append(parent.name) + else: + entries.append(parent.name + ' ' + parent.signature) + parent = parent.parent + parent_sig = ' '.join(reversed(entries)) + if len(command.aliases) > 0: aliases = '|'.join(command.aliases) fmt = '[%s|%s]' % (command.name, aliases) - if parent: - fmt = parent + ' ' + fmt + if parent_sig: + fmt = parent_sig + ' ' + fmt alias = fmt else: - alias = command.name if not parent else parent + ' ' + command.name + alias = command.name if not parent_sig else parent_sig + ' ' + command.name return '%s%s %s' % (self.clean_prefix, alias, command.signature) |