#[non_exhaustive]pub struct AttachmentOption {
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 file_types: Vec<CompactString>,
}Expand description
An attachment option.
discord.js counterpart: APIApplicationCommandAttachmentOption (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.
file_types: Vec<CompactString>The file types to accept (extensions only; all when empty).
Implementations§
Source§impl AttachmentOption
impl AttachmentOption
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 attachment option accepting every file type, named name and described by description, without translations.
Nothing is validated; djs-builders checks Discord’s rules.
discord.js counterpart: SlashCommandAttachmentOption (@discordjs/builders).
Trait Implementations§
Source§impl Clone for AttachmentOption
impl Clone for AttachmentOption
Source§impl Debug for AttachmentOption
impl Debug for AttachmentOption
impl Eq for AttachmentOption
Source§impl PartialEq for AttachmentOption
impl PartialEq for AttachmentOption
Source§impl Serialize for AttachmentOption
impl Serialize for AttachmentOption
impl StructuralPartialEq for AttachmentOption
Auto Trait Implementations§
impl Forget for AttachmentOption
impl Freeze for AttachmentOption
impl Move for AttachmentOption
impl RefUnwindSafe for AttachmentOption
impl Send for AttachmentOption
impl Sync for AttachmentOption
impl Unpin for AttachmentOption
impl UnsafeUnpin for AttachmentOption
impl UnwindSafe for AttachmentOption
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