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 for CommandOptionValue
impl PartialEq for CommandOptionValue
impl StructuralPartialEq for CommandOptionValue
Auto Trait Implementations§
impl Freeze for CommandOptionValue
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)