Struct CommandOptionBuilder
zaun_bot::CommandOptionBuilder · Struct
pub struct CommandOptionBuilder(…)Builds a CommandOption.
Methods
Section titled “Methods”pub fn new<impl Into<String>, impl Into<String>>(kind: OptionKind, name: impl Into<String>, description: impl Into<String>) -> SelfAn option of kind. name: 1–32 lowercase; description: 1–100.
string
Section titled “string”pub fn string<impl Into<String>, impl Into<String>>(name: impl Into<String>, description: impl Into<String>) -> SelfA text option.
integer
Section titled “integer”pub fn integer<impl Into<String>, impl Into<String>>(name: impl Into<String>, description: impl Into<String>) -> SelfAn integer option.
pub fn user<impl Into<String>, impl Into<String>>(name: impl Into<String>, description: impl Into<String>) -> SelfA member option.
required
Section titled “required”pub fn required(self) -> SelfMust be filled.
autocomplete
Section titled “autocomplete”pub fn autocomplete(self) -> SelfAsk the bot for suggestions as the invoker types (Bot::on_autocomplete).
choice
Section titled “choice”pub fn choice<impl Into<String>, impl Into<String>>(self, name: impl Into<String>, value: impl Into<String>) -> SelfAdds a fixed text choice (≤ 25; not with autocomplete).
pub fn range(self, min: f64, max: f64) -> SelfNumeric bounds (integer and number options).
length
Section titled “length”pub fn length(self, min: u16, max: u16) -> SelfLength bounds (text options, 0–6 000).
pub fn build(self) -> CommandOptionThe finished option.
Trait implementations
Section titled “Trait implementations”Clone, Debug