This is going to be a short-ish guide on sub-classing help as ?tag new help
isn't great at explaining things
- Don't subclass
HelpCommand
unless you're going to override every one of thesend_x
methods, because that class does not do anything (it literally just returns None) DefaultHelpCommand
is for the default help command (the code block one)MinimalHelpCommand
is a minimalistic version of the help command, this is an example of the command produced if you copy?tag new help
HelpCommand
is a completely blank slate and can be subclassed to look any way you want, although most people use them for embeds
The first thing you need with any subclassed help command is an __init__
. For the main examples I will use the HelpCommand
class as it is the one I am most familiar with.
class HelpCommand(commands.HelpCommand):
def __init__(self):
super().__init__(command_attrs={
'help': 'Shows help about the bot, a command, or a category' # This is the command.help string
'cooldown': commands.Cooldown(1, 3.0, commands.BucketType.member), # these are custom attributes passed to the help command
})