Module component

Source
Expand description

Constants, error types, and functions for validating Components.

Structs§

ComponentValidationError
A provided Component is invalid.

Enums§

ComponentValidationErrorType
Type of ComponentValidationError that occurred.

Constants§

ACTION_ROW_COMPONENT_COUNT
Maximum number of Components allowed inside an ActionRow.
COMPONENT_BUTTON_LABEL_LENGTH
Maximum Component label length in codepoints.
COMPONENT_COUNT
Maximum number of root Components in a message.
COMPONENT_CUSTOM_ID_LENGTH
Maximum length of a Component custom ID in codepoints.
SELECT_MAXIMUM_VALUES_LIMIT
Maximum number of SelectMenuOptions that can be chosen in a SelectMenu.
SELECT_MAXIMUM_VALUES_REQUIREMENT
Minimum number of SelectMenuOptions that can be chosen in a SelectMenu.
SELECT_MINIMUM_VALUES_LIMIT
Maximum number of SelectMenuOptions that must be chosen in a SelectMenu.
SELECT_OPTION_COUNT
Maximum number of SelectMenuOptions in a SelectMenu.
SELECT_OPTION_DESCRIPTION_LENGTH
Maximum length of a SelectMenuOption::description in codepoints.
SELECT_OPTION_LABEL_LENGTH
Maximum length of a SelectMenuOption::label in codepoints.
SELECT_OPTION_VALUE_LENGTH
Maximum length of a SelectMenuOption::value in codepoints.
SELECT_PLACEHOLDER_LENGTH
Maximum length of a SelectMenu::placeholder in codepoints.
TEXT_INPUT_LABEL_MAX
Maximum length of TextInput::label.
TEXT_INPUT_LABEL_MIN
Minimum length of TextInput::label.
TEXT_INPUT_LENGTH_MAX
Maximum length of TextInput::value.
TEXT_INPUT_LENGTH_MIN
Minimum length of TextInput::value.
TEXT_INPUT_PLACEHOLDER_MAX
Maximum length of a TextInput::placeholder in codepoints.

Functions§

action_row
Ensure that an action row is correct.
button
Ensure that a button is correct.
component
Ensure that a top-level request component is correct.
select_menu
Ensure that a select menu is correct.
text_input
Ensure that a text input is correct.