pub struct CommandOption {
pub option_type: OptionType,
pub name: String,
pub description: String,
pub required: bool,
pub choices: Vec<CommandChoice>,
pub options: Vec<CommandOption>,
pub channel_types: Vec<u8>,
pub min_value: Option<Value>,
pub max_value: Option<Value>,
pub min_length: Option<u16>,
pub max_length: Option<u16>,
pub autocomplete: bool,
}Expand description
Option for a command.
Fields§
§option_type: OptionTypeType of option.
name: StringName (1-32 chars).
description: StringDescription (1-100 chars).
required: boolWhether required.
choices: Vec<CommandChoice>Choices (for string/int/number).
options: Vec<CommandOption>Sub-options (for SubCommand/SubCommandGroup).
channel_types: Vec<u8>Channel types specific.
min_value: Option<Value>Min value (int/number).
max_value: Option<Value>Max value (int/number).
min_length: Option<u16>Min length (string).
max_length: Option<u16>Max length (string).
autocomplete: boolWhether to autocomplete.
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 · 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
Auto Trait Implementations§
impl Freeze for CommandOption
impl RefUnwindSafe for CommandOption
impl Send for CommandOption
impl Sync for CommandOption
impl Unpin 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