lightbulb.commands.groups

class lightbulb.commands.groups.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: hikari.Locale, localization_provider: localization.LocalizationProviderT) hikari.api.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 (str) – The name of the subgroup.

  • description (str) – The description of the subgroup.

  • localize (bool, optional) – 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: hikari.UndefinedOr[hikari.Permissions]

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 lightbulb.commands.groups.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: hikari.Locale, localization_provider: localization.LocalizationProviderT) hikari.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.