From 42a1a68662f8338a5c6b03e834a646278a90fc08 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 25 Aug 2023 11:36:25 -0400 Subject: [PATCH] [commands] Fix obscuring name error --- discord/ext/commands/cog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 3ca0b7731..f2004c93e 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -335,11 +335,11 @@ class Cog(metaclass=CogMeta): # Hybrid commands already deal with updating the reference # Due to the copy below, so we need to handle them specially if hasattr(parent, '__commands_is_hybrid__') and hasattr(command, '__commands_is_hybrid__'): - app_command: Optional[Union[app_commands.Group, app_commands.Command[Self, ..., Any]]] = getattr( + current: Optional[Union[app_commands.Group, app_commands.Command[Self, ..., Any]]] = getattr( command, 'app_command', None ) updated = app_command_refs.get(command.qualified_name) - if app_command and updated: + if current and updated: command.app_command = updated # type: ignore # Safe attribute access # Update our parent's reference to our self