@@ -541,7 +541,7 @@ def command(self, **kwargs):
541
541
def create_group (
542
542
self ,
543
543
name : str ,
544
- description : str ,
544
+ description : Optional [ str ] = None ,
545
545
guild_ids : Optional [List [int ]] = None ,
546
546
) -> SlashCommandGroup :
547
547
"""A shortcut method that creates a slash command group with no subcommands and adds it to the internal
@@ -553,7 +553,7 @@ def create_group(
553
553
----------
554
554
name: :class:`str`
555
555
The name of the group to create.
556
- description: :class:`str`
556
+ description: Optional[ :class:`str`]
557
557
The description of the group to create.
558
558
guild_ids: Optional[List[:class:`int`]]
559
559
A list of the IDs of each guild this group should be added to, making it a guild command.
@@ -564,14 +564,15 @@ def create_group(
564
564
SlashCommandGroup
565
565
The slash command group that was created.
566
566
"""
567
+ description = description or "No description provided."
567
568
group = SlashCommandGroup (name , description , guild_ids )
568
569
self .add_application_command (group )
569
570
return group
570
571
571
572
def group (
572
573
self ,
573
574
name : str ,
574
- description : str ,
575
+ description : Optional [ str ] = None ,
575
576
guild_ids : Optional [List [int ]] = None ,
576
577
) -> Callable [[Type [SlashCommandGroup ]], SlashCommandGroup ]:
577
578
"""A shortcut decorator that initializes the provided subclass of :class:`.SlashCommandGroup`
@@ -583,7 +584,7 @@ def group(
583
584
----------
584
585
name: :class:`str`
585
586
The name of the group to create.
586
- description: :class:`str`
587
+ description: Optional[ :class:`str`]
587
588
The description of the group to create.
588
589
guild_ids: Optional[List[:class:`int`]]
589
590
A list of the IDs of each guild this group should be added to, making it a guild command.
@@ -595,7 +596,14 @@ def group(
595
596
The slash command group that was created.
596
597
"""
597
598
def inner (cls : Type [SlashCommandGroup ]) -> SlashCommandGroup :
598
- group = cls (name , description , guild_ids = guild_ids )
599
+ group = cls (
600
+ name ,
601
+ (
602
+ description or inspect .cleandoc (cls .__doc__ ).splitlines ()[0 ]
603
+ if cls .__doc__ is not None else "No description provided"
604
+ ),
605
+ guild_ids = guild_ids
606
+ )
599
607
self .add_application_command (group )
600
608
return group
601
609
return inner
0 commit comments