#[non_exhaustive]pub struct SubCommandOption {
pub name: CompactString,
pub name_localizations: BTreeMap<Locale, CompactString>,
pub description: CompactString,
pub description_localizations: BTreeMap<Locale, CompactString>,
pub name_localized: Option<CompactString>,
pub description_localized: Option<CompactString>,
pub options: Vec<CommandOption>,
}Expand description
A subcommand or a subcommand group.
discord.js counterpart: APIApplicationCommandSubcommandOption / APIApplicationCommandSubcommandGroupOption (discord-api-types).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: CompactStringThe name (1-32 characters).
name_localizations: BTreeMap<Locale, CompactString>Translations of the name.
description: CompactStringThe description (1-100 characters).
description_localizations: BTreeMap<Locale, CompactString>Translations of the description.
name_localized: Option<CompactString>The name in the requester’s locale, from endpoints that do not return the full translations.
description_localized: Option<CompactString>The description in the requester’s locale (see name_localized).
options: Vec<CommandOption>The options of a subcommand, or the subcommands of a group.
Implementations§
Source§impl SubCommandOption
impl SubCommandOption
Sourcepub fn new(
name: impl Into<CompactString>,
description: impl Into<CompactString>,
) -> Self
pub fn new( name: impl Into<CompactString>, description: impl Into<CompactString>, ) -> Self
Creates a subcommand or a subcommand group, named name and described by description, without translations.
Nothing is validated; djs-builders checks Discord’s rules.
discord.js counterpart: SlashCommandSubcommandBuilder (@discordjs/builders).
Trait Implementations§
Source§impl Clone for SubCommandOption
impl Clone for SubCommandOption
Source§impl Debug for SubCommandOption
impl Debug for SubCommandOption
Source§impl PartialEq for SubCommandOption
impl PartialEq for SubCommandOption
Source§impl Serialize for SubCommandOption
impl Serialize for SubCommandOption
impl StructuralPartialEq for SubCommandOption
Auto Trait Implementations§
impl Freeze for SubCommandOption
impl RefUnwindSafe for SubCommandOption
impl Send for SubCommandOption
impl Sync for SubCommandOption
impl Unpin for SubCommandOption
impl UnsafeUnpin for SubCommandOption
impl UnwindSafe for SubCommandOption
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