Struct serenity::model::application::command::CommandOption
source · [−]#[non_exhaustive]pub struct CommandOption {Show 14 fields
pub kind: CommandOptionType,
pub name: String,
pub name_localizations: Option<HashMap<String, String>>,
pub description: String,
pub description_localizations: Option<HashMap<String, String>>,
pub required: bool,
pub choices: Vec<CommandOptionChoice>,
pub options: Vec<CommandOption>,
pub channel_types: Vec<ChannelType>,
pub min_value: Option<Number>,
pub max_value: Option<Number>,
pub min_length: Option<u16>,
pub max_length: Option<u16>,
pub autocomplete: bool,
}
Expand description
The parameters for an Command
.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: CommandOptionType
The option type.
name: String
The option name.
name_localizations: Option<HashMap<String, String>>
Localizations of the option name with locale as the key
description: String
The option description.
description_localizations: Option<HashMap<String, String>>
Localizations of the option description with locale as the key
required: bool
Whether the parameter is optional or required.
choices: Vec<CommandOptionChoice>
Choices the user can pick from.
Note: Only available for String
and Integer
CommandOptionType
.
options: Vec<CommandOption>
The nested options.
Note: Only available for SubCommand
or SubCommandGroup
.
channel_types: Vec<ChannelType>
If the option is a Channel
, it will only be able to show these types.
min_value: Option<Number>
Minimum permitted value for Integer or Number options
max_value: Option<Number>
Maximum permitted value for Integer or Number options
min_length: Option<u16>
Minimum permitted length for String options
max_length: Option<u16>
Maximum permitted length for String options
autocomplete: bool
Trait Implementations
sourceimpl Clone for CommandOption
impl Clone for CommandOption
sourcefn clone(&self) -> CommandOption
fn clone(&self) -> CommandOption
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CommandOption
impl Debug for CommandOption
sourceimpl<'de> Deserialize<'de> for CommandOption
impl<'de> Deserialize<'de> for CommandOption
sourcefn 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
sourceimpl Serialize for CommandOption
impl Serialize for CommandOption
Auto Trait Implementations
impl RefUnwindSafe for CommandOption
impl Send for CommandOption
impl Sync for CommandOption
impl Unpin for CommandOption
impl UnwindSafe for CommandOption
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more