mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
[commands] Fix obscuring name error
This commit is contained in:
parent
69e9bc9454
commit
42a1a68662
@ -335,11 +335,11 @@ class Cog(metaclass=CogMeta):
|
|||||||
# Hybrid commands already deal with updating the reference
|
# Hybrid commands already deal with updating the reference
|
||||||
# Due to the copy below, so we need to handle them specially
|
# Due to the copy below, so we need to handle them specially
|
||||||
if hasattr(parent, '__commands_is_hybrid__') and hasattr(command, '__commands_is_hybrid__'):
|
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
|
command, 'app_command', None
|
||||||
)
|
)
|
||||||
updated = app_command_refs.get(command.qualified_name)
|
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
|
command.app_command = updated # type: ignore # Safe attribute access
|
||||||
|
|
||||||
# Update our parent's reference to our self
|
# Update our parent's reference to our self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user