twilight_validate::component

Function select_menu

source
pub fn select_menu(
    select_menu: &SelectMenu,
) -> Result<(), ComponentValidationError>
Expand description

Ensure that a select menu is correct.

§Errors

Returns an error of type ComponentCustomIdLength if the provided custom ID is too long.

Returns an error of type ComponentLabelLength if the provided button label is too long.

Returns an error of type SelectMaximumValuesCount if the provided number of select menu values that can be chosen is smaller than the minimum or larger than the maximum.

Returns an error of type SelectMinimumValuesCount if the provided number of select menu values that must be chosen is larger than the maximum.

Returns an error of type SelectOptionDescriptionLength if a provided select option description is too long.

Returns an error of type SelectOptionLabelLength if a provided select option label is too long.

Returns an error of type SelectOptionValueLength error type if a provided select option value is too long.

Returns an error of type SelectPlaceholderLength if a provided select placeholder is too long.

Returns an error of type SelectUnsupportedDefaultValues if the select menu’s type doesn’t support the default_values field.

Returns an error of type SelectNotEnoughDefaultValues if the select menu specifies fewer default values than its minimum values property.

Returns an error of type SelectTooManyDefaultValues if the select menu specifies more default values than its maximum values property.