#[non_exhaustive]pub struct IntegerOption {
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 choices: Vec<Choice<i64>>,
pub min_value: Option<i64>,
pub max_value: Option<i64>,
pub autocomplete: bool,
}Expand description
An integer option.
discord.js counterpart: APIApplicationCommandIntegerOption (discord-api-types).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
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.
choices: Vec<Choice<i64>>The values to choose from (max 25).
min_value: Option<i64>The minimum value.
max_value: Option<i64>The maximum value.
autocomplete: boolWhether the app suggests values through autocomplete interactions.
Implementations§
Source§impl IntegerOption
impl IntegerOption
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 integer option without choices or bounds, named name and described by description, without translations.
Nothing is validated; djs-builders checks Discord’s rules.
discord.js counterpart: SlashCommandIntegerOption (@discordjs/builders).