How to remove or change the default help command?

43.2k views Asked by At

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.

6

There are 6 answers

1
Daniel Pearce On BEST ANSWER

Try this:

bot.remove_command('help')

Put this at the top of your code, after your imports. Then create your own.

Or to format it check this out: Click here!

0
catsock 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.

0
Ram1611 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
0
YYCDoesPython 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')
0
ME immortal On

Here you can use this:

intents = discord.Intents.all()

activity = discord.Game(name=f"!help in {len(client.guilds)} servers!")

client = commands.Bot(command_prefix="!", intents=intents, activity=activity, status=discord.Status.do_not_disturb, help_command=None)
0
Akash 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