get_command_usage_message function: works with subcommands as well
This commit is contained in:
parent
c54e7af00a
commit
bdaecd96cd
|
|
@ -56,7 +56,8 @@ class VocalMaisBot(commands.Cog):
|
||||||
raise discord_utils.CheckFailDoNotNotify
|
raise discord_utils.CheckFailDoNotNotify
|
||||||
|
|
||||||
def get_command_usage_message(self, command: commands.Command) -> str:
|
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()
|
@commands.Cog.listener()
|
||||||
async def on_command_error(self, ctx: commands.Context, error: commands.CommandError):
|
async def on_command_error(self, ctx: commands.Context, error: commands.CommandError):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue