Skip to content

Commit 6d4cb00

Browse files
committed
Allow nesting group classes
1 parent 22ebd11 commit 6d4cb00

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

discord/commands/commands.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,15 @@ def __new__(cls, *args, **kwargs) -> SlashCommandGroup:
732732

733733
self.__initial_commands__ = []
734734
for i, c in cls.__dict__.items():
735+
if isinstance(c, type) and SlashCommandGroup in c.__bases__:
736+
c = c(
737+
c.__name__,
738+
(
739+
inspect.cleandoc(cls.__doc__).splitlines()[0]
740+
if cls.__doc__ is not None
741+
else "No description provided"
742+
)
743+
)
735744
if isinstance(c, (SlashCommand, SlashCommandGroup)):
736745
c.parent = self
737746
c.attached_to_group = True

0 commit comments

Comments
 (0)