Enum twilight_model::application::command::CommandOption
source · [−]pub enum CommandOption {
SubCommand(OptionsCommandOptionData),
SubCommandGroup(OptionsCommandOptionData),
String(ChoiceCommandOptionData),
Integer(NumberCommandOptionData),
Boolean(BaseCommandOptionData),
User(BaseCommandOptionData),
Channel(ChannelCommandOptionData),
Role(BaseCommandOptionData),
Mentionable(BaseCommandOptionData),
Number(NumberCommandOptionData),
Attachment(BaseCommandOptionData),
}Expand description
Option for a Command.
It can also be nested under another CommandOption of type SubCommand
or SubCommandGroup.
Choices and options are mutually exclusive.
Variants
SubCommand(OptionsCommandOptionData)
SubCommandGroup(OptionsCommandOptionData)
String(ChoiceCommandOptionData)
Integer(NumberCommandOptionData)
Boolean(BaseCommandOptionData)
User(BaseCommandOptionData)
Channel(ChannelCommandOptionData)
Role(BaseCommandOptionData)
Mentionable(BaseCommandOptionData)
Number(NumberCommandOptionData)
Attachment(BaseCommandOptionData)
Implementations
sourceimpl CommandOption
impl CommandOption
pub const fn kind(&self) -> CommandOptionType
sourcepub const fn is_autocomplete(&self) -> bool
pub const fn is_autocomplete(&self) -> bool
Whether the command supports autocomplete.
pub const fn is_required(&self) -> 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 moresourceimpl Debug for CommandOption
impl Debug for CommandOption
sourceimpl<'de> Deserialize<'de> for CommandOption
impl<'de> Deserialize<'de> for CommandOption
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<CommandOption> for CommandOption
impl PartialEq<CommandOption> for CommandOption
sourcefn eq(&self, other: &CommandOption) -> bool
fn eq(&self, other: &CommandOption) -> bool
sourceimpl Serialize for CommandOption
impl Serialize for CommandOption
impl StructuralPartialEq 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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