#[non_exhaustive]pub enum CommandOptionValue {
Show 13 variants
SubCommand(Vec<CommandDataOption>),
SubCommandGroup(Vec<CommandDataOption>),
String(CompactString),
Integer(i64),
Boolean(bool),
User(UserId),
Channel(ChannelId),
Role(RoleId),
Mentionable(GenericId),
Number(f64),
Attachment(AttachmentId),
Focused {
kind: CommandOptionType,
value: CompactString,
},
Unknown(CommandOptionType),
}Expand description
The value of a CommandDataOption, by option type.
Snowflake values (users, channels, roles, mentionables, attachments) are IDs; the objects
they refer to are in the command’s Resolved data.
discord.js counterpart: the value of an APIApplicationCommandInteractionDataOption (discord-api-types).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SubCommand(Vec<CommandDataOption>)
A subcommand and its options.
SubCommandGroup(Vec<CommandDataOption>)
A subcommand group and its (single) subcommand.
String(CompactString)
A string.
Integer(i64)
An integer.
Boolean(bool)
A boolean.
User(UserId)
A user (also in Resolved::users and, in guilds, Resolved::members).
Channel(ChannelId)
A channel (in Resolved::channels).
Role(RoleId)
A role (in Resolved::roles).
Mentionable(GenericId)
A user or a role (in the matching Resolved map).
Number(f64)
A floating-point number.
Attachment(AttachmentId)
An attachment (in Resolved::attachments).
Focused
The option being typed in an autocomplete interaction: what the user has typed so far, which need not be valid for the option’s type yet.
Unknown(CommandOptionType)
An option type this version does not know; its value is not kept.
Implementations§
Source§impl CommandOptionValue
impl CommandOptionValue
Sourcepub const fn kind(&self) -> CommandOptionType
pub const fn kind(&self) -> CommandOptionType
Returns the option type.
discord.js counterpart: CommandInteractionOption#type.