how do i format my default help command?

You can override certain functions in the default help command. Below is an official example on how to set this up initially:

class MyHelpCommand(commands.MinimalHelpCommand):
    def get_command_signature(self, command):
        return '{0.clean_prefix}{1.qualified_name} {1.signature}'.format(self, command)

class MyCog(commands.Cog):
    def __init__(self, bot):
        self._original_help_command = bot.help_command
        bot.help_command = MyHelpCommand()
        bot.help_command.cog = self

    def cog_unload(self):
        self.bot.help_command = self._original_help_command

The example above overrides the implementation of get_command_signature.

As you can see, you’re supposed to create a new HelpCommand class and change the functions. Stuff that you don’t want to change can just be left untouched, you don’t have to copy-paste the existing code in there.

To see what a HelpCommand and MinimalHelpCommand can do (to override the methods), I suggest scrolling through the relevant API Documentation.

This way, in case there’s something that you don’t like about the default help, you can just change it’s behaviour and fix it yourself. In your case, you’re gonna want to sort the list of commands before adding them to the codeblock.

I recommend flicking through the default implementation’s functions to see what you have to change about it. In your case, send_bot_help, send_cog_help, send_command_help, and send_group_help will need the lists sorted.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top