#[non_exhaustive]pub struct ChannelSelect {
pub id: Option<i32>,
pub custom_id: CompactString,
pub channel_types: Vec<ChannelType>,
pub placeholder: Option<CompactString>,
pub default_values: Vec<SelectDefaultValue>,
pub min_values: Option<u8>,
pub max_values: Option<u8>,
pub required: bool,
pub disabled: bool,
}Expand description
A channel select: a menu of channels that Discord fills in.
discord.js counterpart: ChannelSelectMenuComponent / ChannelSelectMenuBuilder.
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).
channel_types: Vec<ChannelType>The channel types to offer (all when empty).
placeholder: Option<CompactString>The text shown when nothing is selected (max 150 characters).
default_values: Vec<SelectDefaultValue>The channels selected by default.
min_values: Option<u8>The minimum number of channels to choose (Discord’s default: 1; 0-25).
max_values: Option<u8>The maximum number of channels 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 ChannelSelect
impl ChannelSelect
Sourcepub fn new(custom_id: impl Into<CompactString>) -> Self
pub fn new(custom_id: impl Into<CompactString>) -> Self
Creates a channel select menu.
discord.js counterpart: ChannelSelectMenuBuilder (@discordjs/builders).