#[non_exhaustive]pub enum ComponentValidationErrorType {
Show 24 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,
},
}
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: ButtonStyle
Style 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: ComponentType
Type of provided component.
InvalidRootComponent
Provided component cannot be a root component.
Fields
kind: ComponentType
Type 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: SelectMenuType
The 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
.