@@ -963,17 +963,19 @@ class SlashCommandGroup(ApplicationCommand):
963
963
Whether the command should only be usable inside a guild.
964
964
default_member_permissions: :class:`~discord.Permissions`
965
965
The default permissions a member needs to be able to run the command.
966
- subcommands: List[Union[:class:`SlashCommand`, :class:`SlashCommandGroup`]]
967
- The list of all subcommands under this group.
968
- cog: Optional[:class:`.Cog`]
969
- The cog that this command belongs to. ``None`` if there isn't one.
970
966
checks: List[Callable[[:class:`.ApplicationContext`], :class:`bool`]]
971
967
A list of predicates that verifies if the command could be executed
972
968
with the given :class:`.ApplicationContext` as the sole parameter. If an exception
973
969
is necessary to be thrown to signal failure, then one inherited from
974
970
:exc:`.ApplicationCommandError` should be used. Note that if the checks fail then
975
971
:exc:`.CheckFailure` exception is raised to the :func:`.on_application_command_error`
976
972
event.
973
+ name_localizations: Optional[Dict[:class:`str`, :class:`str`]]
974
+ The name localizations for this command. The values of this should be ``"locale": "name"``. See
975
+ `here <https://discord.com/developers/docs/reference#locales>`_ for a list of valid locales.
976
+ description_localizations: Optional[Dict[:class:`str`, :class:`str`]]
977
+ The description localizations for this command. The values of this should be ``"locale": "description"``.
978
+ See `here <https://discord.com/developers/docs/reference#locales>`_ for a list of valid locales.
977
979
"""
978
980
__initial_commands__ : List [Union [SlashCommand , SlashCommandGroup ]]
979
981
type = 1
@@ -1003,7 +1005,7 @@ def __new__(cls, *args, **kwargs) -> SlashCommandGroup:
1003
1005
def __init__ (
1004
1006
self ,
1005
1007
name : str ,
1006
- description : str ,
1008
+ description : Optional [ str ] = None ,
1007
1009
guild_ids : Optional [List [int ]] = None ,
1008
1010
parent : Optional [SlashCommandGroup ] = None ,
1009
1011
** kwargs ,
@@ -1070,6 +1072,7 @@ def create_subgroup(
1070
1072
name : str ,
1071
1073
description : Optional [str ] = None ,
1072
1074
guild_ids : Optional [List [int ]] = None ,
1075
+ ** kwargs ,
1073
1076
) -> SlashCommandGroup :
1074
1077
"""
1075
1078
Creates a new subgroup for this SlashCommandGroup.
@@ -1083,6 +1086,23 @@ def create_subgroup(
1083
1086
guild_ids: Optional[List[:class:`int`]]
1084
1087
A list of the IDs of each guild this group should be added to, making it a guild command.
1085
1088
This will be a global command if ``None`` is passed.
1089
+ guild_only: :class:`bool`
1090
+ Whether the command should only be usable inside a guild.
1091
+ default_member_permissions: :class:`~discord.Permissions`
1092
+ The default permissions a member needs to be able to run the command.
1093
+ checks: List[Callable[[:class:`.ApplicationContext`], :class:`bool`]]
1094
+ A list of predicates that verifies if the command could be executed
1095
+ with the given :class:`.ApplicationContext` as the sole parameter. If an exception
1096
+ is necessary to be thrown to signal failure, then one inherited from
1097
+ :exc:`.ApplicationCommandError` should be used. Note that if the checks fail then
1098
+ :exc:`.CheckFailure` exception is raised to the :func:`.on_application_command_error`
1099
+ event.
1100
+ name_localizations: Optional[Dict[:class:`str`, :class:`str`]]
1101
+ The name localizations for this command. The values of this should be ``"locale": "name"``. See
1102
+ `here <https://discord.com/developers/docs/reference#locales>`_ for a list of valid locales.
1103
+ description_localizations: Optional[Dict[:class:`str`, :class:`str`]]
1104
+ The description localizations for this command. The values of this should be ``"locale": "description"``.
1105
+ See `here <https://discord.com/developers/docs/reference#locales>`_ for a list of valid locales.
1086
1106
1087
1107
Returns
1088
1108
--------
@@ -1092,9 +1112,9 @@ def create_subgroup(
1092
1112
1093
1113
if self .parent is not None :
1094
1114
# TODO: Improve this error message
1095
- raise Exception ("Subcommands can only be nested once " )
1115
+ raise Exception ("a subgroup cannot have a subgroup " )
1096
1116
1097
- sub_command_group = SlashCommandGroup (name , description , guild_ids , parent = self )
1117
+ sub_command_group = SlashCommandGroup (name , description , guild_ids , parent = self , ** kwargs )
1098
1118
self .subcommands .append (sub_command_group )
1099
1119
return sub_command_group
1100
1120
0 commit comments