How do you remove or at least change the format of the default help command in discord.py?
I think changing the format would be nice, I don't really like the format at all.
How do you remove or at least change the format of the default help command in discord.py?
I think changing the format would be nice, I don't really like the format at all.
On
You will need to remove the command for example
client.remove_command('help')
you will need to put it under
client = commands.Bot
it will be like
client = commands.Bot(command_prefix = 'somethingelse')
client.remove_command('help')
On
This is how you should do it so that it preserves the behavior of the help command while letting you change how it looks:
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```
See the documentation: https://discordpy.readthedocs.io/en/rewrite/ext/commands/api.html#help-commands for more details.
For migrating from old helpformatters: https://discordpy.readthedocs.io/en/rewrite/migrating.html#helpformatter-and-help-command-changes
On
The proper way to disable the help command according to the docs is to pass help_command=None into the constructor for discord.ext.commands.Bot, such as:
bot = commands.Bot(help_command=None)
or
class MyBot(commands.Bot):
def __init__(self):
super().__init__(help_command=None)
This also allows you the opportunity to pass your own help function into the help_command argument for different formatting.
On
You don't really need to remove the command... It isn't good, using the (prefix)help commandname <- It wont appear then... If you want it embed you can do.
class NewHelpName(commands.MinimalHelpCommand):
async def send_pages(self):
destination = self.get_destination()
for page in self.paginator.pages:
emby = discord.Embed(description=page)
await destination.send(embed=emby)
client.help_command = NewHelpName()```
The built in help command is of great use
Try this:
Put this at the top of your code, after your imports. Then create your own.
Or to format it check this out: Click here!