lightbulb.commands.groups¶
- class Group(name: str, description: str, localize: bool = False, nsfw: bool = False, dm_enabled: bool = True, default_member_permissions: Permissions | UndefinedType = UNDEFINED)[source]¶
Dataclass representing a slash command group.
Note
If
localize
isTrue
, thenname
anddescription
will instead be interpreted as localization keys from which the actual name and description will be retrieved from.- async as_command_builder(default_locale: Locale, localization_provider: localization.LocalizationProvider) CommandBuilder [source]¶
Convert the group into a hikari command builder object.
- Returns:
The builder object for this group.
- Return type:
- subgroup(name: str, description: str, *, localize: bool = False) SubGroup [source]¶
Create a new subgroup as a child of this group.
- Parameters:
name – The name of the subgroup.
description – The description of the subgroup.
localize – Whether to localize the group’s name and description. If
true
, then thename
anddescription
arguments will instead be interpreted as localization keys from which the actual name and description will be retrieved from. Defaults toFalse
.
- Returns:
The created subgroup.
- Return type:
- default_member_permissions: Permissions | UndefinedType¶
The default permissions required to use the group in a guild.
- class SubGroup(name: str, description: str, localize: bool, parent: Group)[source]¶
Dataclass representing a slash command subgroup.
Warning
This should not be instantiated manually - you should instead create one using
Group.subgroup()
.- async to_command_option(default_locale: Locale, localization_provider: localization.LocalizationProvider) CommandOption [source]¶
Convert the subgroup into a subgroup command option.
- Returns:
The subgroup option for this subgroup.
- Return type: