From cc2dcdcdbf9e6057053bdb72bba848f4c2e19cbd Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Tue, 23 Aug 2022 20:46:14 +0100 Subject: Use extension utils from bot-core --- bot/bot.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bot/bot.py') diff --git a/bot/bot.py b/bot/bot.py index 226f9890..9309f50c 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -60,3 +60,11 @@ class Bot(BotBase): # This is not awaited to avoid a deadlock with any cogs that have # wait_until_guild_available in their cog_load method. scheduling.create_task(self.load_extensions(exts)) + + async def invoke_help_command(self, ctx: commands.Context) -> None: + """Invoke the help command or default help command if help extensions is not loaded.""" + if "bot.exts.core.help" in ctx.bot.extensions: + help_command = ctx.bot.get_command("help") + await ctx.invoke(help_command, ctx.command.qualified_name) + return + await ctx.send_help(ctx.command) -- cgit v1.2.3