# CommandOption

[https://github.com/flamexdev/dsc-utils/blob/main/package/src/structures/commandOption.js](https://github.com/flamexdev/dsc-utils/blob/main/package/src/structures/commandOption.js)

{% tabs %}
{% tab title="name" %}
| Type   | Description                                             | Required |
| ------ | ------------------------------------------------------- | :------: |
| string |  1-32 lowercase character name matching `^[\w-]{1,32}$` |    Yes   |
{% endtab %}

{% tab title="description" %}
| Type   | Description                  | Required |
| ------ | ---------------------------- | :------: |
| string |  1-100 character description |    Yes   |
{% endtab %}

{% tab title="type" %}
| Type             | Description            | Required |
| ---------------- | ---------------------- | :------: |
| string or Number |  the type of the value |    Yes   |

List of available types: [https://discord.com/developers/docs/interactions/slash-commands#application-command-object-application-command-option-type](https://discord.com/developers/docs/interactions/slash-commands#application-command-object-application-command-option-type)

{% hint style="warning" %}
All of these types can be provided with their value (Number) or name (string) (upper- and lowercase)
{% endhint %}
{% endtab %}

{% tab title="required" %}
| Type    | Description                               | Default | Required |
| ------- | ----------------------------------------- | ------- | :------: |
| boolean |  if the parameter is required or optional | false   |    No    |
{% endtab %}

{% tab title="choices" %}
| Type                    | Description                                                    | Required |
| ----------------------- | -------------------------------------------------------------- | :------: |
| array of CommandChoices | choices for `string` and `int` types for the user to pick from |    No    |

{% content-ref url="commandchoice" %}
[commandchoice](commandchoice)
{% endcontent-ref %}
{% endtab %}

{% tab title="options" %}
| Type                    | Description                                                                                        | Required |
| ----------------------- | -------------------------------------------------------------------------------------------------- | :------: |
| array of CommandOptions | if the option is a subcommand or subcommand group type, this nested options will be the parameters |    No    |

{% content-ref url="commandoption" %}
[commandoption](commandoption)
{% endcontent-ref %}
{% endtab %}
{% endtabs %}

