EveCogs/newhelpmenu/__init__.py
everestmcarthur 61131b28ee fix: remove help command in setup() before cog loads — no more conflict
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.
2026-05-07 22:49:45 +00:00

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()