[commands] Force HybridGroup to always have invoke_without_command

This commit is contained in:
Rapptz 2022-04-13 17:14:03 -04:00
parent 49f330b4a3
commit 7a52aa3764

View File

@ -429,6 +429,8 @@ class HybridGroup(Group[CogT, P, T]):
Note that application commands groups cannot have callbacks associated with them, so the callback Note that application commands groups cannot have callbacks associated with them, so the callback
is only called if it's not invoked as an application command. is only called if it's not invoked as an application command.
Hybrid groups will always have :attr:`invoke_without_command` set to ``True``.
These are not created manually, instead they are created via the These are not created manually, instead they are created via the
decorator or functional interface. decorator or functional interface.
@ -439,6 +441,7 @@ class HybridGroup(Group[CogT, P, T]):
def __init__(self, *args: Any, **attrs: Any) -> None: def __init__(self, *args: Any, **attrs: Any) -> None:
super().__init__(*args, **attrs) super().__init__(*args, **attrs)
self.invoke_without_command = True
parent = None parent = None
if self.parent is not None: if self.parent is not None:
if isinstance(self.parent, HybridGroup): if isinstance(self.parent, HybridGroup):