Module twilight_util::builder::command[][src]

This is supported on crate feature builder only.
Expand description

Create a Command with a builder.

Examples

use twilight_model::application::command::CommandType;
use twilight_util::builder::command::{BooleanBuilder, CommandBuilder, StringBuilder};

CommandBuilder::new(
    "blep".into(),
    "Send a random adorable animal photo".into(),
    CommandType::ChatInput,
)
.option(
    StringBuilder::new("animal".into(), "The type of animal".into())
        .required(true)
        .choices([
            ("Dog".into(), "animal_dog".into()),
            ("Cat".into(), "animal_cat".into()),
            ("Penguin".into(), "animal_penguin".into()),
        ]),
)
.option(BooleanBuilder::new(
    "only_smol".into(),
    "Whether to show only baby animals".into(),
));

Structs

Create a boolean option with a builder.

Create a channel option with a builder.

Builder to create a Command.

Create a integer option with a builder.

Create a mentionable option with a builder.

Create a Number option with a builder.

Create a role option with a builder.

Create a string option with a builder.

Create a subcommand option with a builder.

Create a subcommand group option with a builder.

Create a user option with a builder.