#[non_exhaustive]pub enum ComponentValidationErrorType {
Show 37 variants
ActionRowComponentCount {
count: usize,
},
ButtonConflict,
ButtonStyle {
style: ButtonStyle,
},
ComponentCount {
count: usize,
},
ComponentCustomIdLength {
chars: usize,
},
ComponentLabelLength {
chars: usize,
},
InvalidChildComponent {
kind: ComponentType,
},
InvalidRootComponent {
kind: ComponentType,
},
SelectMaximumValuesCount {
count: usize,
},
SelectMinimumValuesCount {
count: usize,
},
SelectNotEnoughDefaultValues {
provided: usize,
min: usize,
},
SelectOptionsMissing,
SelectOptionCount {
count: usize,
},
SelectOptionDescriptionLength {
chars: usize,
},
SelectOptionLabelLength {
chars: usize,
},
SelectOptionValueLength {
chars: usize,
},
SelectPlaceholderLength {
chars: usize,
},
SelectTooManyDefaultValues {
provided: usize,
max: usize,
},
SelectUnsupportedDefaultValues {
kind: SelectMenuType,
},
TextInputLabelLength {
len: usize,
},
TextInputMaxLength {
len: usize,
},
TextInputMinLength {
len: usize,
},
TextInputPlaceholderLength {
chars: usize,
},
TextInputValueLength {
chars: usize,
},
TextInputDisallowedLabel,
DisallowedV2Components,
DisallowedChildren,
TextDisplayContentTooLong {
len: usize,
},
MediaGalleryItemCountOutOfRange {
count: usize,
},
MediaGalleryItemDescriptionTooLong {
len: usize,
},
SectionComponentCountOutOfRange {
count: usize,
},
SelectDisallowedDisabled,
ThumbnailDescriptionTooLong {
len: usize,
},
LabelLabelTooLong {
len: usize,
},
LabelDescriptionTooLong {
len: usize,
},
FileUploadMaximumValuesCount {
count: u8,
},
FileUploadMinimumValuesCount {
count: u8,
},
}Expand description
Type of ComponentValidationError that occurred.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ActionRowComponentCount
Number of components a provided ActionRow is larger than
the maximum.
ButtonConflict
Button has both a custom ID and URL set.
ButtonStyle
Button does not have the required field based on its style.
A button with a style of ButtonStyle::Link must have a URL set,
while buttons of other styles must have a custom ID set.
Fields
style: ButtonStyleStyle of the button.
ComponentCount
Number of components provided is larger than the maximum.
ComponentCustomIdLength
Component custom ID is larger than the the maximum.
ComponentLabelLength
Component label is larger than the maximum.
InvalidChildComponent
Provided component cannot be a child component.
Fields
kind: ComponentTypeType of provided component.
InvalidRootComponent
Provided component cannot be a root component.
Fields
kind: ComponentTypeType of provided component.
SelectMaximumValuesCount
Maximum number of items that can be chosen is smaller than the minimum or larger than the maximum.
SelectMinimumValuesCount
Minimum number of items that must be chosen is larger than the maximum.
SelectNotEnoughDefaultValues
The select menu specifies less default values than its own minimum values requirement.
Fields
SelectOptionsMissing
The options field is None for a text select menu.
SelectOptionCount
Number of select menu options provided is larger than the maximum.
SelectOptionDescriptionLength
Description of a select menu option is larger than the maximum.
SelectOptionLabelLength
Label of a select menu option is larger than the maximum.
SelectOptionValueLength
Value of a select menu option is larger than the maximum.
SelectPlaceholderLength
Placeholder of a component is larger than the maximum.
SelectTooManyDefaultValues
The select menu specifies less default values than its own minimum values requirement.
Fields
SelectUnsupportedDefaultValues
The select menu type doesn’t support the default_values field.
Fields
kind: SelectMenuTypeThe select menu’s type.
TextInputLabelLength
TextInput::label is invalid.
TextInputMaxLength
TextInput::max_length is invalid.
TextInputMinLength
TextInput::min_length is too long.
TextInputPlaceholderLength
Placeholder of a TextInput component is larger than
TEXT_INPUT_PLACEHOLDER_MAX.
TextInputValueLength
Value of a TextInput component is larger than
TEXT_INPUT_LENGTH_MAX.
TextInputDisallowedLabel
A TextInput component contained a label in a context where it is not allowed.
DisallowedV2Components
V2 components used in a V1 component.
DisallowedChildren
Disallowed children components are found in a root component.
TextDisplayContentTooLong
Content of text display component is too long.
MediaGalleryItemCountOutOfRange
The number of items in a media gallery is out of range.
MediaGalleryItemDescriptionTooLong
The description of a media gallery item is too long.
SectionComponentCountOutOfRange
The number of components in a section is out of range.
SelectDisallowedDisabled
A select component’s disabled field was true in a context where disabled selects are
not allowed.
ThumbnailDescriptionTooLong
The length of the thumbnail description is too long.
LabelLabelTooLong
The length of the label text of a label is too long.
LabelDescriptionTooLong
The length of the description of a label is too long.
FileUploadMaximumValuesCount
Maximum number of files that can be uploaded is larger than the maximum.
Fields
count: u8Provided value for FileUpload::max_values.
FileUploadMinimumValuesCount
Minimum number of files that must be uploaded is larger than the maximum.
Fields
count: u8Value provided for FileUpload::min_values.