pub struct CommandOptionBuilder(/* private fields */);Expand description
Builds a CommandOption.
Implementations§
Source§impl CommandOptionBuilder
impl CommandOptionBuilder
Sourcepub fn new(
kind: OptionKind,
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn new( kind: OptionKind, name: impl Into<String>, description: impl Into<String>, ) -> Self
An option of kind. name: 1–32 lowercase; description: 1–100.
Sourcepub fn integer(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn integer(name: impl Into<String>, description: impl Into<String>) -> Self
An integer option.
Sourcepub fn autocomplete(self) -> Self
pub fn autocomplete(self) -> Self
Ask the bot for suggestions as the invoker types (Bot::on_autocomplete).
Sourcepub fn choice(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn choice(self, name: impl Into<String>, value: impl Into<String>) -> Self
Adds a fixed text choice (≤ 25; not with autocomplete).
Sourcepub fn build(self) -> CommandOption
pub fn build(self) -> CommandOption
The finished option.
Trait Implementations§
Source§impl Clone for CommandOptionBuilder
impl Clone for CommandOptionBuilder
Source§fn clone(&self) -> CommandOptionBuilder
fn clone(&self) -> CommandOptionBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CommandOptionBuilder
impl RefUnwindSafe for CommandOptionBuilder
impl Send for CommandOptionBuilder
impl Sync for CommandOptionBuilder
impl Unpin for CommandOptionBuilder
impl UnsafeUnpin for CommandOptionBuilder
impl UnwindSafe for CommandOptionBuilder
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