def setup(bot: Bot) -> None: """ The setup for the help extension. This is called automatically on `bot.load_extension` being run. Stores the original help command instance on the `bot._old_help` attribute for later reinstatement, before removing it from the command registry so the new help command can be loaded successfully. If an exception is raised during the loading of the cog, `unload` will be called in order to reinstate the original help command. """ bot._old_help = bot.get_command("help") bot.remove_command("help") try: bot.add_cog(Help()) except Exception: unload(bot) raise