The classic Red/discord.py pattern: bot.remove_command('help') in
__init__.py's setup() BEFORE bot.add_cog(), so the cog's own
@commands.command(name='help') decorator doesn't clash with Red's
built-in help.
Original help command stored on cog instance and restored in cog_unload.
12 lines
400 B
Python
12 lines
400 B
Python
from .newhelpmenu import NewHelpMenu
|
|
|
|
|
|
async def setup(bot):
|
|
# Remove Red's built-in help command BEFORE adding the cog,
|
|
# so our cog's @commands.command(name="help") doesn't conflict.
|
|
original_help = bot.remove_command("help")
|
|
|
|
cog = NewHelpMenu(bot)
|
|
cog._original_help_command = original_help # store for restore on unload
|
|
await bot.add_cog(cog)
|
|
await cog.initialize()
|