hikari.components#
Application and entities that are used to describe components on Discord.
Module Contents#
- class hikari.components.ActionRowComponent[source]#
Bases:
Generic
[AllowedComponentsT
],PartialComponent
Represents a row of components.
- class hikari.components.ButtonComponent[source]#
Bases:
PartialComponent
Represents a button component.
- custom_id: str | None[source]#
Developer defined identifier for this button (will be <= 100 characters).
Note
This is required for the following button styles:
- emoji: hikari.emojis.Emoji | None[source]#
Custom or unicode emoji which appears on the button.
- style: ButtonStyle | int[source]#
The button’s style.
- url: str | None[source]#
Url for
ButtonStyle.LINK
style buttons.
- class hikari.components.ButtonStyle[source]#
Bases:
int
,hikari.internal.enums.Enum
Enum of the available button styles.
More information, such as how these look, can be found at https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
- class hikari.components.ChannelSelectMenuComponent[source]#
Bases:
SelectMenuComponent
Represents a channel select menu component.
- channel_types: Sequence[int | hikari.channels.ChannelType][source]#
The valid channel types for this menu.
- class hikari.components.ComponentType[source]#
Bases:
int
,hikari.internal.enums.Enum
Types of components found within Discord.
- ACTION_ROW = 1[source]#
A non-interactive container component for other types of components.
Note
As this is a container component it can never be contained within another component and therefore will always be top-level.
Note
As of writing this can only contain one component type.
- BUTTON = 2[source]#
A button component.
Note
This cannot be top-level and must be within a container component such as
ComponentType.ACTION_ROW
.
- CHANNEL_SELECT_MENU = 8[source]#
A channel select component.
Note
This cannot be top-level and must be within a container component such as
ComponentType.ACTION_ROW
.
- MENTIONABLE_SELECT_MENU = 7[source]#
A mentionable (users and roles) select component.
Note
This cannot be top-level and must be within a container component such as
ComponentType.ACTION_ROW
.
- ROLE_SELECT_MENU = 6[source]#
A role select component.
Note
This cannot be top-level and must be within a container component such as
ComponentType.ACTION_ROW
.
- TEXT_INPUT = 4[source]#
A text input component.
Note
This component may only be used inside a modal container.
Note
This cannot be top-level and must be within a container component such as
ComponentType.ACTION_ROW
.
- TEXT_SELECT_MENU = 3[source]#
A text select component.
Note
This cannot be top-level and must be within a container component such as
ComponentType.ACTION_ROW
.
- USER_SELECT_MENU = 5[source]#
A user select component.
Note
This cannot be top-level and must be within a container component such as
ComponentType.ACTION_ROW
.
- class hikari.components.PartialComponent[source]#
Base class for all component entities.
- type: ComponentType | int[source]#
The type of component this is.
- class hikari.components.SelectMenuComponent[source]#
Bases:
PartialComponent
Represents a select menu component.
- max_values: int[source]#
The minimum amount of options which can be chosen for this menu.
This will be less than or equal to 25 and will be greater than or equal to
SelectMenuComponent.min_values
.
- min_values: int[source]#
The minimum amount of options which must be chosen for this menu.
This will be greater than or equal to 0 and will be less than or equal to
SelectMenuComponent.max_values
.
- class hikari.components.SelectMenuOption[source]#
Represents an option for a
SelectMenuComponent
.- emoji: hikari.emojis.Emoji | None[source]#
Custom or unicode emoji which appears on the button.
- class hikari.components.TextInputComponent[source]#
Bases:
PartialComponent
Represents a text input component.
- class hikari.components.TextInputStyle[source]#
Bases:
int
,hikari.internal.enums.Enum
A text input style.
- class hikari.components.TextSelectMenuComponent[source]#
Bases:
SelectMenuComponent
Represents a text select menu component.
- options: Sequence[SelectMenuOption][source]#
Sequence of up to 25 of the options set for this menu.
- hikari.components.InteractiveButtonTypes: AbstractSet[InteractiveButtonTypesT][source]#
Set of the
ButtonType
which are valid for interactive buttons.The following values are included in this:
- hikari.components.InteractiveButtonTypesT[source]#
Type hints of the
ButtonStyle
values which are valid for interactive buttons.The following values are valid for this:
- hikari.components.MessageComponentTypesT[source]#
Type hint of the
PartialComponent
that be contained in aMessageActionRowComponent
.The following values are valid for this:
- hikari.components.ModalComponentTypesT[source]#
Type hint of the
PartialComponent
that be contained in aModalActionRowComponent
.The following values are valid for this: