#[non_exhaustive]pub struct ComponentData {
pub custom_id: CompactString,
pub component_type: ComponentType,
pub values: Vec<CompactString>,
pub resolved: Option<Box<Resolved>>,
}Expand description
The data of a component interaction: which button or select menu was used, and what was selected.
discord.js counterpart: MessageComponentInteraction (customId, componentType) and the
select menu interactions (values).
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.custom_id: CompactStringThe component’s custom ID.
component_type: ComponentTypeThe component’s type.
values: Vec<CompactString>The selected values (select menus): option values of string selects, IDs (as strings)
of the other selects (see ids).
resolved: Option<Box<Resolved>>The selected users, members, roles and channels (entity select menus).
Implementations§
Source§impl ComponentData
impl ComponentData
Source§impl ComponentData
The selections of entity select menus with their resolved objects (D-250), in the order
of values.
impl ComponentData
The selections of entity select menus with their resolved objects (D-250), in the order
of values.
Sourcepub fn users(&self) -> impl Iterator<Item = &User> + '_
pub fn users(&self) -> impl Iterator<Item = &User> + '_
Returns the users chosen in a user or mentionable select menu.
discord.js counterpart: UserSelectMenuInteraction#users.
Sourcepub fn members(&self) -> impl Iterator<Item = (&User, &InteractionMember)> + '_
pub fn members(&self) -> impl Iterator<Item = (&User, &InteractionMember)> + '_
Returns the users chosen in a user or mentionable select menu in a guild, with their member data.
discord.js counterpart: UserSelectMenuInteraction#members.
Sourcepub fn roles(&self) -> impl Iterator<Item = &Role> + '_
pub fn roles(&self) -> impl Iterator<Item = &Role> + '_
Returns the roles chosen in a role or mentionable select menu.
discord.js counterpart: RoleSelectMenuInteraction#roles.
Sourcepub fn channels(&self) -> impl Iterator<Item = &InteractionChannel> + '_
pub fn channels(&self) -> impl Iterator<Item = &InteractionChannel> + '_
Returns the channels chosen in a channel select menu.
discord.js counterpart: ChannelSelectMenuInteraction#channels.
Sourcepub fn mentionables(&self) -> impl Iterator<Item = Mentionable<'_>> + '_
pub fn mentionables(&self) -> impl Iterator<Item = Mentionable<'_>> + '_
Returns the users and roles chosen in a mentionable select menu.
discord.js counterpart: MentionableSelectMenuInteraction (users, members,
roles).