@@ -532,14 +532,47 @@ def command(self, **kwargs):
532
532
"""
533
533
return self .application_command (** kwargs )
534
534
535
- def command_group (
536
- self , name : str , description : str , guild_ids = None
535
+ def create_group (
536
+ self , name : str , description : str , guild_ids : Optional [ List [ int ]] = None
537
537
) -> SlashCommandGroup :
538
- # TODO: Write documentation for this. I'm not familiar enough with what this function does to do it myself.
538
+ """A shortcut method that creates a slash command group with no subcommands and adds it to the internal
539
+ command list via :meth:`~.ApplicationCommandMixin.add_application_command`.
540
+
541
+ .. versionadded:: 2.0
542
+
543
+ Returns
544
+ --------
545
+ SlashCommandGroup
546
+ The slash command group that was created.
547
+ """
539
548
group = SlashCommandGroup (name , description , guild_ids )
540
549
self .add_application_command (group )
541
550
return group
542
551
552
+ def group (
553
+ self ,
554
+ name : str ,
555
+ description : str ,
556
+ guild_ids : Optional [List [int ]] = None ,
557
+ ) -> Callable [[Type [SlashCommandGroup ]], SlashCommandGroup ]:
558
+ """A shortcut decorator that initializes the provided subclass of :class:`.SlashCommandGroup`
559
+ and adds it to the internal command list via :meth:`~.ApplicationCommandMixin.add_application_command`.
560
+
561
+ .. versionadded:: 2.0
562
+
563
+ Returns
564
+ --------
565
+ Callable[[Type[SlashCommandGroup]], SlashCommandGroup]
566
+ The slash command group that was created.
567
+ """
568
+ def inner (cls : Type [SlashCommandGroup ]) -> SlashCommandGroup :
569
+ group = cls (name , description , guild_ids = guild_ids )
570
+ self .add_application_command (group )
571
+ return group
572
+ return inner
573
+
574
+ slash_group = group
575
+
543
576
async def get_application_context (
544
577
self , interaction : Interaction , cls = None
545
578
) -> ApplicationContext :
0 commit comments