# Struct CommandOptionBuilder

> Builds a `CommandOption`.

`zaun_bot::CommandOptionBuilder` · Struct

```rust
pub struct CommandOptionBuilder(…)
```

Builds a `CommandOption`.

## Methods

### `new`

```rust
pub fn new<impl Into<String>, impl Into<String>>(kind: OptionKind, name: impl Into<String>, description: impl Into<String>) -> Self
```

An option of `kind`. `name`: 1–32 lowercase; `description`: 1–100.

### `string`

```rust
pub fn string<impl Into<String>, impl Into<String>>(name: impl Into<String>, description: impl Into<String>) -> Self
```

A text option.

### `integer`

```rust
pub fn integer<impl Into<String>, impl Into<String>>(name: impl Into<String>, description: impl Into<String>) -> Self
```

An integer option.

### `user`

```rust
pub fn user<impl Into<String>, impl Into<String>>(name: impl Into<String>, description: impl Into<String>) -> Self
```

A member option.

### `required`

```rust
pub fn required(self) -> Self
```

Must be filled.

### `autocomplete`

```rust
pub fn autocomplete(self) -> Self
```

Ask the bot for suggestions as the invoker types (`Bot::on_autocomplete`).

### `choice`

```rust
pub fn choice<impl Into<String>, impl Into<String>>(self, name: impl Into<String>, value: impl Into<String>) -> Self
```

Adds a fixed text choice (≤ 25; not with autocomplete).

### `range`

```rust
pub fn range(self, min: f64, max: f64) -> Self
```

Numeric bounds (integer and number options).

### `length`

```rust
pub fn length(self, min: u16, max: u16) -> Self
```

Length bounds (text options, 0–6 000).

### `build`

```rust
pub fn build(self) -> CommandOption
```

The finished option.

## Trait implementations

`Clone`, `Debug`

[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/options/struct.CommandOptionBuilder.html)
