From bdaecd96cdd38947abe1cb4aa4a62c1390d48967 Mon Sep 17 00:00:00 2001 From: Elnath Date: Tue, 12 Jan 2021 00:53:40 +0100 Subject: [PATCH] get_command_usage_message function: works with subcommands as well --- VocalMaisBot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VocalMaisBot.py b/VocalMaisBot.py index 25934d5..b2e3e21 100755 --- a/VocalMaisBot.py +++ b/VocalMaisBot.py @@ -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):