Struct command::object::CommandOption
zaun_community_protocol::command::object::CommandOption · Struct
pub struct CommandOption { … }An option of a command or subcommand.
Fields
Section titled “Fields”kind: OptionType
Section titled “kind: OptionType”The kind of value.
name: String
Section titled “name: String”1–32, Discord’s name pattern.
name_localizations: BTreeMap<String, String>
Section titled “name_localizations: BTreeMap<String, String>”Localized names.
description: String
Section titled “description: String”1–100 scalars.
description_localizations: BTreeMap<String, String>
Section titled “description_localizations: BTreeMap<String, String>”Localized descriptions.
required: bool
Section titled “required: bool”Required options come before optional ones; never on subcommands.
choices: Vec<Choice>
Section titled “choices: Vec<Choice>”≤ 25 fixed choices (string, integer and number options).
options: Vec<CommandOption>
Section titled “options: Vec<CommandOption>”Subcommand and group children.
channel_types: Vec<ChannelKind>
Section titled “channel_types: Vec<ChannelKind>”Channel options: the kinds offered.
min_value: Option<f64>
Section titled “min_value: Option<f64>”Integer and number bounds.
max_value: Option<f64>
Section titled “max_value: Option<f64>”Integer and number bounds.
min_length: Option<u32>
Section titled “min_length: Option<u32>”String length bounds, 0–6 000.
max_length: Option<u32>
Section titled “max_length: Option<u32>”String length bounds, 1–6 000.
autocomplete: bool
Section titled “autocomplete: bool”The bot suggests values as the invoker types (not with choices).
Trait implementations
Section titled “Trait implementations”Clone, Debug, Deserialize<'de>, PartialEq, Serialize, StructuralPartialEq