get_command_usage_message function: works with subcommands as well

This commit is contained in:
Elnath 2021-01-12 00:53:40 +01:00
parent c54e7af00a
commit bdaecd96cd
1 changed files with 2 additions and 1 deletions

View File

@ -56,7 +56,8 @@ class VocalMaisBot(commands.Cog):
raise discord_utils.CheckFailDoNotNotify
def get_command_usage_message(self, command: commands.Command) -> str:
return f"Usage: `@{self.bot.user.display_name} {command.name} {command.signature}`"
command_elements = [str(cmd) for cmd in command.parents] + [command.name]
return f"Usage: `@{self.bot.user.display_name} {' '.join(command_elements)} {command.signature}`"
@commands.Cog.listener()
async def on_command_error(self, ctx: commands.Context, error: commands.CommandError):