#[non_exhaustive]pub struct ChannelOption {
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 required: bool,
pub channel_types: Vec<ChannelType>,
}Expand description
A channel option.
discord.js counterpart: APIApplicationCommandChannelOption (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).
required: boolWhether the option must be filled.
channel_types: Vec<ChannelType>The channel types offered (all when empty).
Implementations§
Source§impl ChannelOption
impl ChannelOption
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 an optional channel option offering every channel type, named name and described by description, without translations.
Nothing is validated; djs-builders checks Discord’s rules.
discord.js counterpart: SlashCommandChannelOption (@discordjs/builders).
Trait Implementations§
Source§impl Clone for ChannelOption
impl Clone for ChannelOption
Source§impl Debug for ChannelOption
impl Debug for ChannelOption
impl Eq for ChannelOption
Source§impl PartialEq for ChannelOption
impl PartialEq for ChannelOption
Source§impl Serialize for ChannelOption
impl Serialize for ChannelOption
impl StructuralPartialEq for ChannelOption
Auto Trait Implementations§
impl Freeze for ChannelOption
impl RefUnwindSafe for ChannelOption
impl Send for ChannelOption
impl Sync for ChannelOption
impl Unpin for ChannelOption
impl UnsafeUnpin for ChannelOption
impl UnwindSafe for ChannelOption
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