From 6cef8408e86249ce1b25a456732db442df93b8b8 Mon Sep 17 00:00:00 2001 From: Flame442 <34169552+Flame442@users.noreply.github.com> Date: Thu, 27 Apr 2023 20:01:46 -0400 Subject: [PATCH] Fix help breaking when removing a command without removing its cog (#6104) --- redbot/core/commands/help.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/redbot/core/commands/help.py b/redbot/core/commands/help.py index ec3377849..ebf15ff04 100644 --- a/redbot/core/commands/help.py +++ b/redbot/core/commands/help.py @@ -274,10 +274,7 @@ class RedHelpFormatter(HelpFormatterABC): async def get_cog_help_mapping( self, ctx: Context, obj: commands.Cog, help_settings: HelpSettings ): - if obj is None: - iterator = filter(lambda c: c.parent is None and c.cog is None, ctx.bot.commands) - else: - iterator = obj.get_commands() + iterator = filter(lambda c: c.parent is None and c.cog is obj, ctx.bot.commands) return { com.name: com async for com in self.help_filter_func(ctx, iterator, help_settings=help_settings)