# Struct command::object::CommandOption

> An option of a command or subcommand.

`zaun_community_protocol::command::object::CommandOption` · Struct

```rust
pub struct CommandOption { … }
```

An option of a command or subcommand.

## Fields

### `kind: OptionType`

The kind of value.

### `name: String`

1–32, Discord's name pattern.

### `name_localizations: BTreeMap<String, String>`

Localized names.

### `description: String`

1–100 scalars.

### `description_localizations: BTreeMap<String, String>`

Localized descriptions.

### `required: bool`

Required options come before optional ones; never on subcommands.

### `choices: Vec<Choice>`

≤ 25 fixed choices (string, integer and number options).

### `options: Vec<CommandOption>`

Subcommand and group children.

### `channel_types: Vec<ChannelKind>`

Channel options: the kinds offered.

### `min_value: Option<f64>`

Integer and number bounds.

### `max_value: Option<f64>`

Integer and number bounds.

### `min_length: Option<u32>`

String length bounds, 0–6 000.

### `max_length: Option<u32>`

String length bounds, 1–6 000.

### `autocomplete: bool`

The bot suggests values as the invoker types (not with `choices`).

## Trait implementations

`Clone`, `Debug`, `Deserialize<'de>`, `PartialEq`, `Serialize`, `StructuralPartialEq`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/command/object/app_command/struct.CommandOption.html)
