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 is True, then name and description 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:

hikari.api.CommandBuilder

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 the name and description arguments will instead be interpreted as localization keys from which the actual name and description will be retrieved from. Defaults to False.

Returns:

The created subgroup.

Return type:

SubGroup

default_member_permissions: Permissions | UndefinedType

The default permissions required to use the group in a guild.

description: str

The description of the group.

dm_enabled: bool

Whether the group is enabled in direct messages.

localize: bool

Whether the group name and description should be localized.

name: str

The name of the group.

nsfw: bool

Whether the group should be marked as nsfw. Defaults to False.

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:

hikari.CommandOption

description: str

The description of the subgroup.

localize: bool

Whether the group name and description should be localized.

name: str

The name of the subgroup.

parent: Group

The parent group of the subgroup.