From e873b8294a0683ede6cd1dfe5797ac5cdddc55c8 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 1 May 2022 15:01:01 -0400 Subject: [PATCH] [commands] Properly set group parent for hybrid commands in cogs --- discord/ext/commands/cog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 6fff5a2f5..31ec17fac 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -292,7 +292,8 @@ class Cog(metaclass=CogMeta): elif self.__cog_app_commands_group__: if hasattr(command, '__commands_is_hybrid__') and command.parent is None: # In both of these, the type checker does not see the app_command attribute even though it exists - command.app_command = command.app_command._copy_with(parent=self, binding=self) # type: ignore + parent = self.__cog_app_commands_group__ + command.app_command = command.app_command._copy_with(parent=parent, binding=self) # type: ignore children.append(command.app_command) # type: ignore for command in cls.__cog_app_commands__: