Skip to content

Commit

Permalink
docs(twilight-model)!: Streamline select menu documentation
Browse files Browse the repository at this point in the history
This commit streamlines the language in the `SelectMenu` and
`SelectMenuType` documentation. In particular, it removes duplicated
sections outlining required and optional fields. Moreover, it makes
language describing which menu types use a specific option more in
line with the rest of the library.
  • Loading branch information
archer-321 committed Jun 25, 2023
1 parent c774adc commit ab68bfb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions twilight-model/src/channel/message/component/select_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
pub struct SelectMenu {
/// An optional list of channel types.
///
/// This option is only used for [channel select menus](SelectMenuType::Channel).
/// This is only applicable to [channel select menus](SelectMenuType::Channel).
pub channel_types: Option<Vec<ChannelType>>,
/// Developer defined identifier.
pub custom_id: String,
Expand All @@ -17,16 +17,14 @@ pub struct SelectMenu {
/// Defaults to `false`.
pub disabled: bool,
/// This select menu's type.
///
/// [Text select menus](SelectMenuType::Text) *must* also set the `options` field.
pub kind: SelectMenuType,
/// Maximum number of options that may be chosen.
pub max_values: Option<u8>,
/// Minimum number of options that must be chosen.
pub min_values: Option<u8>,
/// A list of available options.
///
/// This value is only used and required by [text select menus](SelectMenuType::Text).
/// This is required by [text select menus](SelectMenuType::Text).
pub options: Option<Vec<SelectMenuOption>>,
/// Custom placeholder text if no option is selected.
pub placeholder: Option<String>,
Expand All @@ -48,9 +46,6 @@ pub enum SelectMenuType {
/// Mentionable select menus.
Mentionable,
/// Channel select menus.
///
/// Select menus of this `kind` *can* use the `channel_types` field to specify which types of
/// channels are selectable.
Channel,
}

Expand Down

0 comments on commit ab68bfb

Please sign in to comment.