#[non_exhaustive]pub struct StringSelect {
pub id: Option<i32>,
pub custom_id: CompactString,
pub options: Vec<SelectOption>,
pub placeholder: Option<CompactString>,
pub min_values: Option<u8>,
pub max_values: Option<u8>,
pub required: bool,
pub disabled: bool,
}Expand description
A string select: a menu of developer-defined options (in an action row in messages, in a label in modals).
discord.js counterpart: StringSelectMenuComponent / StringSelectMenuBuilder.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: Option<i32>The component’s numeric identifier (generated by Discord when not set).
custom_id: CompactStringThe developer-defined identifier (1-100 characters).
options: Vec<SelectOption>The options (max 25).
placeholder: Option<CompactString>The text shown when nothing is selected (max 150 characters).
min_values: Option<u8>The minimum number of options to choose (Discord’s default: 1; 0-25).
max_values: Option<u8>The maximum number of options to choose (Discord’s default: 1; max 25).
required: boolWhether an answer is required in a modal (default true; ignored in messages).
disabled: boolWhether the menu is disabled (messages only; modals reject it).
Implementations§
Source§impl StringSelect
impl StringSelect
Sourcepub fn new(
custom_id: impl Into<CompactString>,
options: Vec<SelectOption>,
) -> Self
pub fn new( custom_id: impl Into<CompactString>, options: Vec<SelectOption>, ) -> Self
Creates a select menu with the given options.
discord.js counterpart: StringSelectMenuBuilder (@discordjs/builders).