Module component

Module component 

Source
Expand description

Constants, error types, and functions for validating [Component]s.

Structs§

ComponentValidationError
A provided [Component] is invalid.

Enums§

ComponentValidationErrorType
Type of ComponentValidationError that occurred.

Constants§

ACTION_ROW_COMPONENT_COUNT
Maximum number of [Component]s allowed inside an [ActionRow].
COMPONENT_BUTTON_LABEL_LENGTH
Maximum [Component] label length in codepoints.
COMPONENT_COUNT
Maximum number of root [Component]s in a message.
COMPONENT_CUSTOM_ID_LENGTH
Maximum length of a [Component] custom ID in codepoints.
COMPONENT_V2_COUNT
Maximum total number of [Component]s in a component V2 message.
FILE_UPLOAD_MAXIMUM_VALUES_LIMIT
Maximum value of FileUpload::max_values.
FILE_UPLOAD_MINIMUM_VALUES_LIMIT
Maximum value of FileUpload::min_values.
LABEL_DESCRIPTION_LENGTH_MAX
Maximum length of a label description.
LABEL_LABEL_LENGTH_MAX
Maximum length of the label text of a label component.
MEDIA_GALLERY_ITEMS_MAX
Maximum amount of items in a media gallery.
MEDIA_GALLERY_ITEMS_MIN
Minimum amount of items in a media gallery.
MEDIA_GALLERY_ITEM_DESCRIPTION_LENGTH_MAX
Maximum length of a description of a media gallery item.
SECTION_COMPONENTS_MAX
Maximum amount of components in a section.
SECTION_COMPONENTS_MIN
Minimum amount of components in a section.
SELECT_MAXIMUM_VALUES_LIMIT
Maximum number of [SelectMenuOption]s that can be chosen in a [SelectMenu].
SELECT_MAXIMUM_VALUES_REQUIREMENT
Minimum number of [SelectMenuOption]s that can be chosen in a [SelectMenu].
SELECT_MINIMUM_VALUES_LIMIT
Maximum number of [SelectMenuOption]s that must be chosen in a [SelectMenu].
SELECT_OPTION_COUNT
Maximum number of [SelectMenuOption]s 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_DISPLAY_CONTENT_LENGTH_MAX
Maximum length of text display content.
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.
THUMBNAIL_DESCRIPTION_LENGTH_MAX
Maximum length of a thumbnail description.

Functions§

action_row
Ensure that an action row is correct.
button
Ensure that a button is correct.
componentDeprecated
Ensure that a top-level request component is correct in V1.
component_v1
Ensure that a top-level request component is correct in V1.
component_v2
Ensure that a top-level request component is correct in V2.
container
Validates a container component.
file_upload
Validates a file upload component.
label
Ensure that a label is correct.
media_gallery
Validates a media gallery component.
media_gallery_item
Validates a media gallery item
section
Validates a section component.
select_menu
Ensure that a select menu is correct.
text_display
Validates a text display component.
text_input
Ensure that a text input is correct.
thumbnail
Validates a thumbnail component.