pub enum CommandOptionValue {
Attachment(Id<AttachmentMarker>),
Boolean(bool),
Channel(Id<ChannelMarker>),
Focused(String, CommandOptionType),
Integer(i64),
Mentionable(Id<GenericMarker>),
Number(f64),
Role(Id<RoleMarker>),
String(String),
SubCommand(Vec<CommandDataOption>),
SubCommandGroup(Vec<CommandDataOption>),
User(Id<UserMarker>),
}
Expand description
Combined value and value type for a CommandDataOption
.
Variants§
Attachment(Id<AttachmentMarker>)
Attachment option.
Boolean(bool)
Boolean option.
Channel(Id<ChannelMarker>)
Channel option.
Focused(String, CommandOptionType)
Focused option.
Since Discord does not validate focused fields, they are sent as strings. This means that you will not necessarily get a valid number from number options.
See Discord Docs/Autocomplete.
The actual CommandOptionType
is available through the second tuple value.
Integer(i64)
Integer option.
Mentionable(Id<GenericMarker>)
Mentionable option.
Number(f64)
Number option.
Role(Id<RoleMarker>)
Role option.
String(String)
String option.
SubCommand(Vec<CommandDataOption>)
Subcommand option.
SubCommandGroup(Vec<CommandDataOption>)
Subcommand group option.
User(Id<UserMarker>)
User option.
Implementations§
source§impl CommandOptionValue
impl CommandOptionValue
pub const fn kind(&self) -> CommandOptionType
Trait Implementations§
source§impl Clone for CommandOptionValue
impl Clone for CommandOptionValue
source§fn clone(&self) -> CommandOptionValue
fn clone(&self) -> CommandOptionValue
Returns a copy 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 CommandOptionValue
impl Debug for CommandOptionValue
source§impl PartialEq<CommandOptionValue> for CommandOptionValue
impl PartialEq<CommandOptionValue> for CommandOptionValue
source§fn eq(&self, other: &CommandOptionValue) -> bool
fn eq(&self, other: &CommandOptionValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CommandOptionValue
Auto Trait Implementations§
impl RefUnwindSafe for CommandOptionValue
impl Send for CommandOptionValue
impl Sync for CommandOptionValue
impl Unpin for CommandOptionValue
impl UnwindSafe for CommandOptionValue
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