Custom help command #252
-
I was working on the implementation of a a help command when i ran into the problem of the command "help" being defined already. After further investigation I realized that the help command is defined internally, however, I would like to either customize it or out right replace it since its currently just a code block of commands. Some things I would like to do are
I looked in the documentation of nextcord and found API refrences for help commands but it doesn't seem to be that well document on how to use them and only gives information like the classes attributes and methods. If someone could point me at an example of a custom help command I could look at or explain how to override the command that would be amazing. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
To disable the default help command put |
Beta Was this translation helpful? Give feedback.
-
From R. Danny (https://discord.com/channels/336642139381301249/559455534965850142/907961071330005052): 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 or, you can set the help_command kwarg to None when instantiating you commands.Bot instance, and write your own. Docs: https://nextcord.readthedocs.io/en/latest/ext/commands/api.html#help-commands Migrating docs: https://nextcord.readthedocs.io/en/latest/migrating.html#helpformatter-and-help-command-changes |
Beta Was this translation helpful? Give feedback.
From R. Danny (https://discord.com/channels/336642139381301249/559455534965850142/907961071330005052):
Create your own help command by subclassing HelpCommand or MinimalHelpCommand, then passing it to bot.help_command:
or, you can set …