lightbulb.commands.groups¶
- class Group(name: str, description: str, localize: bool = False, nsfw: bool = False, integration_types: hikari.UndefinedOr[Sequence[ApplicationIntegrationType]] = UNDEFINED, contexts: hikari.UndefinedOr[Sequence[ApplicationContextType]] = UNDEFINED, default_member_permissions: hikari.UndefinedOr[Permissions] = 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:
- contexts: hikari.UndefinedOr[Sequence[ApplicationContextType]]¶
Interaction contexts where the command can be used. Only affects global commands.
- default_member_permissions: hikari.UndefinedOr[Permissions]¶
The default permissions required to use the group in a guild.
- extension: str | None¶
The extensions that the command’s loader was loaded from, or
None
if not applicable.
- integration_types: hikari.UndefinedOr[Sequence[ApplicationIntegrationType]]¶
Installation contexts where the command is available. Only affects global commands.
- 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:
- property subcommands: dict[str, type[CommandBase]]¶
The subcommands of this subgroup.