Struct SkillSlashOption
pub struct SkillSlashOption {
pub name: String,
pub description: String,
pub description_localizations: BTreeMap<String, String>,
pub kind: String,
pub required: bool,
pub choices: Vec<SkillSlashChoice>,
pub min: Option<f64>,
pub max: Option<f64>,
pub min_length: Option<u32>,
pub max_length: Option<u32>,
}Expand description
A typed option a slash-tagged skill exposes on its slash command. Shaped
after the Discord Application Command Option model but channel-agnostic; a
slash-capable channel maps kind to its wire option type. Declared in
SKILL.toml under [[skill.slash_options]].
Fields§
§name: String§description: String§description_localizations: BTreeMap<String, String>Per-locale translations of description, keyed by Discord locale code.
Empty for unlocalized options. Declared under
[[skill.slash_options]] as description_localizations.
kind: Stringstring | integer | number | boolean | user | channel |
role | mentionable. Unknown values are dropped by the channel.
required: bool§choices: Vec<SkillSlashChoice>Predefined choices (string/integer/number options only). The value is
kept as text and coerced to the option’s type by the channel.
min: Option<f64>Inclusive bounds for integer/number options.
max: Option<f64>§min_length: Option<u32>Length bounds for string options.
max_length: Option<u32>Trait Implementations§
Source§impl Clone for SkillSlashOption
impl Clone for SkillSlashOption
Source§fn clone(&self) -> SkillSlashOption
fn clone(&self) -> SkillSlashOption
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SkillSlashOption
impl Debug for SkillSlashOption
Source§impl<'de> Deserialize<'de> for SkillSlashOption
impl<'de> Deserialize<'de> for SkillSlashOption
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SkillSlashOption
impl PartialEq for SkillSlashOption
Source§fn eq(&self, other: &SkillSlashOption) -> bool
fn eq(&self, other: &SkillSlashOption) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SkillSlashOption
impl Serialize for SkillSlashOption
impl StructuralPartialEq for SkillSlashOption
Auto Trait Implementations§
impl Freeze for SkillSlashOption
impl RefUnwindSafe for SkillSlashOption
impl Send for SkillSlashOption
impl Sync for SkillSlashOption
impl Unpin for SkillSlashOption
impl UnsafeUnpin for SkillSlashOption
impl UnwindSafe for SkillSlashOption
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more