twilight_model/application/interaction/modal/
select_menu.rs

1use crate::id::Id;
2use crate::id::marker::{ChannelMarker, GenericMarker, RoleMarker, UserMarker};
3
4/// User filled in String Select.
5///
6/// See [Discord Docs/String Select Interaction Response Structure].
7///
8/// [Discord Docs/String Select Interaction Response Structure]: https://discord.com/developers/docs/components/reference#string-select-string-select-interaction-response-structure
9pub type ModalInteractionStringSelect = ModalInteractionSelectMenu<String>;
10/// User filled in User Select.
11///
12/// See [Discord Docs/User Select Interaction Response Structure].
13///
14/// [Discord Docs/User Select Interaction Response Structure]: https://discord.com/developers/docs/components/reference#user-select-user-select-interaction-response-structure
15pub type ModalInteractionUserSelect = ModalInteractionSelectMenu<Id<UserMarker>>;
16/// User filled in Role Select.
17///
18/// See [Discord Docs/Role Select Interaction Response Structure].
19///
20/// [Discord Docs/Role Select Interaction Response Structure]: https://discord.com/developers/docs/components/reference#role-select-role-select-interaction-response-structure
21pub type ModalInteractionRoleSelect = ModalInteractionSelectMenu<Id<RoleMarker>>;
22/// User filled in Mentionable Select.
23///
24/// See [Discord Docs/Mentionable Select Interaction Response Structure].
25///
26/// [Discord Docs/Mentionable Select Interaction Response Structure]: https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-interaction-response-structure
27pub type ModalInteractionMentionableSelect = ModalInteractionSelectMenu<Id<GenericMarker>>;
28/// User filled in Channel Select.
29///
30/// See [Discord Docs/Channel Select Interaction Response Structure].
31///
32/// [Discord Docs/Channel Select Interaction Response Structure]: https://discord.com/developers/docs/components/reference#channel-select-channel-select-interaction-response-structure
33pub type ModalInteractionChannelSelect = ModalInteractionSelectMenu<Id<ChannelMarker>>;
34
35/// User filled in [`SelectMenu`].
36///
37/// The `ValueType` generic parameter defines the type of the selected value
38/// (e.g. text, user id, etc.).
39/// See also [`ModalInteractionStringSelect`], [`ModalInteractionUserSelect`],
40/// [`ModalInteractionRoleSelect`], [`ModalInteractionMentionableSelect`],
41/// and [`ModalInteractionChannelSelect`].
42///
43/// [`SelectMenu`]: crate::channel::message::component::SelectMenu
44#[derive(Clone, Debug, Eq, PartialEq)]
45pub struct ModalInteractionSelectMenu<ValueType> {
46    /// Unique identifier for the component.
47    pub id: i32,
48    /// User defined identifier for the component.
49    ///
50    /// See [Discord Docs/Custom ID].
51    ///
52    /// [Discord Docs/Custom ID]: https://discord.com/developers/docs/components/reference#anatomy-of-a-component-custom-id
53    pub custom_id: String,
54    /// The selected values.
55    pub values: Vec<ValueType>,
56}