pub struct CommandOption {Show 14 fields
pub kind: OptionType,
pub name: String,
pub name_localizations: BTreeMap<String, String>,
pub description: String,
pub description_localizations: BTreeMap<String, String>,
pub required: bool,
pub choices: Vec<Choice>,
pub options: Vec<CommandOption>,
pub channel_types: Vec<ChannelKind>,
pub min_value: Option<f64>,
pub max_value: Option<f64>,
pub min_length: Option<u32>,
pub max_length: Option<u32>,
pub autocomplete: bool,
}Expand description
An option of a command or subcommand.
Fields§
§kind: OptionTypeThe kind of value.
name: String1–32, Discord’s name pattern.
name_localizations: BTreeMap<String, String>Localized names.
description: String1–100 scalars.
description_localizations: BTreeMap<String, String>Localized descriptions.
required: boolRequired options come before optional ones; never on subcommands.
choices: Vec<Choice>≤ 25 fixed choices (string, integer and number options).
options: Vec<CommandOption>Subcommand and group children.
channel_types: Vec<ChannelKind>Channel options: the kinds offered.
min_value: Option<f64>Integer and number bounds.
max_value: Option<f64>Integer and number bounds.
min_length: Option<u32>String length bounds, 0–6 000.
max_length: Option<u32>String length bounds, 1–6 000.
autocomplete: boolThe bot suggests values as the invoker types (not with choices).
Trait Implementations§
Source§impl Clone for CommandOption
impl Clone for CommandOption
Source§fn clone(&self) -> CommandOption
fn clone(&self) -> CommandOption
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandOption
impl Debug for CommandOption
Source§impl<'de> Deserialize<'de> for CommandOption
impl<'de> Deserialize<'de> for CommandOption
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CommandOption
impl PartialEq for CommandOption
Source§impl Serialize for CommandOption
impl Serialize for CommandOption
impl StructuralPartialEq for CommandOption
Auto Trait Implementations§
impl Freeze for CommandOption
impl RefUnwindSafe for CommandOption
impl Send for CommandOption
impl Sync for CommandOption
impl Unpin for CommandOption
impl UnsafeUnpin for CommandOption
impl UnwindSafe for CommandOption
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more