> For the complete documentation index, see [llms.txt](https://diswrap.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://diswrap.js.org/classes/commandsbuilder.md).

# commandsBuilder

Class used to build a slash command.

```javascript
new commandsBuilder(commandName, commandDescription)
```

<table><thead><tr><th width="212">Argument</th><th width="91">Type</th><th width="101" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>commandName</td><td>String</td><td>true</td><td>The name of the command</td></tr><tr><td>commandDescription</td><td>String</td><td>true</td><td>The description of the command</td></tr></tbody></table>

Returns: [commandsBuilder](/classes/commandsmanager.md)

## Properties

### command

{% tabs %}
{% tab title="Description" %}
Returns the command at the time it is requested, none formated.
{% endtab %}

{% tab title="Returns" %}
Object
{% endtab %}
{% endtabs %}

## Methods

### addOption

Add an option to the command

```javascript
addOption(type, optionName, optionDescription, required)
```

<table><thead><tr><th width="183">Argument</th><th width="84">Type</th><th width="102" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>type</td><td>String</td><td>true</td><td>The type of the option | Use the SlashCommandOptionType type</td></tr><tr><td>optionName</td><td>String</td><td>true</td><td>The name of the option</td></tr><tr><td>optionDescription</td><td>String</td><td>true</td><td>The description of the option</td></tr><tr><td>required</td><td>Boolean</td><td>false</td><td>Whether the option is required or not</td></tr></tbody></table>

### setPermissions

Set the default member permission of the command.

```javascript
setPermissions(permissions)
```

<table><thead><tr><th width="142">Argument</th><th width="160">Type</th><th width="107" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>permissions</td><td>undefined | null | string | number | bigint</td><td>true</td><td>The permissions to set</td></tr></tbody></table>

### setDMPermissions

Set the default DM permission of the command.

<table><thead><tr><th width="141">Argument</th><th width="161">Type</th><th width="105" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>permissions</td><td>undefined | null | string | number | bigint</td><td>true</td><td>The permissions to set</td></tr></tbody></table>

### setLocaleName

Set the name to a certain locale

```javascript
setLocaleName(locale, name)
```

<table><thead><tr><th width="125">Argument</th><th width="78">Type</th><th width="102" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>locale</td><td>String</td><td>true</td><td>The locale to set the name to | Use the SlashCommandLocale type</td></tr><tr><td>name</td><td>String</td><td>true</td><td>The name to set to the locale</td></tr></tbody></table>

### setLocaleDescription

Set the description to a certain locale

```javascript
setLocaleDescription(locale, name)
```

<table><thead><tr><th width="128">Argument</th><th width="78">Type</th><th width="103" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>locale</td><td>String</td><td>true</td><td>The locale to set the description to | Use SlashCommandLocale type.</td></tr><tr><td>name</td><td>String</td><td>true</td><td>The description to set to the locale</td></tr></tbody></table>
