[commands] Fix decorator order mattering for hybrid commands

This commit is contained in:
Rapptz
2026-02-05 08:56:58 -05:00
parent a7d42b9906
commit 103fe90d8b
2 changed files with 66 additions and 44 deletions

View File

@@ -534,6 +534,10 @@ class HybridCommand(Command[CogT, P, T]):
HybridAppCommand(self) if self.with_app_command else None
)
@property
def __discord_app_commands_unwrap__(self) -> Optional[HybridAppCommand[CogT, Any, T]]:
return self.app_command
@property
def cog(self) -> CogT:
return self._cog
@@ -702,6 +706,10 @@ class HybridGroup(Group[CogT, P, T]):
return None
return self.app_command.get_command(self.fallback) # type: ignore
@property
def __discord_app_commands_unwrap__(self) -> Optional[app_commands.Group]:
return self.app_command
@property
def cog(self) -> CogT:
return self._cog