Fix help command with cogs (#2156)

This bug was introduced in #2122 (whoops)

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
Toby Harradine 2018-09-30 14:19:25 +10:00 committed by GitHub
parent b2497386bb
commit f07b78bd0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,7 +313,10 @@ async def help(ctx: commands.Context, *, command_name: str = ""):
# help by itself just lists our own commands. # help by itself just lists our own commands.
pages = await formatter.format_help_for(ctx, bot) pages = await formatter.format_help_for(ctx, bot)
else: else:
command: commands.Command = bot.get_command(command_name) # First check if it's a cog
command = bot.get_cog(command_name)
if command is None:
command = bot.get_command(command_name)
if command is None: if command is None:
if hasattr(formatter, "format_command_not_found"): if hasattr(formatter, "format_command_not_found"):
msg = await formatter.format_command_not_found(ctx, command_name) msg = await formatter.format_command_not_found(ctx, command_name)