Skip to content

Commit

Permalink
[commands] Fix obscuring name error
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Aug 25, 2023
1 parent 69e9bc9 commit 42a1a68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/ext/commands/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ def __new__(cls, *args: Any, **kwargs: Any) -> Self:
# 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
Expand Down

0 comments on commit 42a1a68

Please sign in to comment.