# Chat Command

**Introduction**&#x20;

Activated for specific chat commands, including subcommands.

{% embed url="<https://youtu.be/hzsV037QbQE>" %}

**Configuration**

1. **Command**: Primary command name (1-32 characters). Do not use slash (**/**) here.
2. **Subcommand Group**: (Optional) Name for a subcommand group. Do not use slash (**/**) here.
3. **Subcommand**: Name for a subcommand. Optional, but required if using Subcommand Group. Do not use slash (**/**) here.
4. **Description**: Description of the command (up to 100 characters).
5. **Permissions**: Define permissions required for the command. Aggregated across multiple automations.
6. **Guild Only**: For custom bots, restricts command to guild channels.
7. **Options**: Set command options (maximum of 25). Each option can include:
   * **Name**: Option name, following a specific format.
   * **Description**: Brief description of the option.
   * **Type**: Type of the option (e.g., string, number, boolean).
   * **Constraints**: Specific constraints like Maximum length, Minimum length, Maximum value, Minimum value, depending on the type.
   * **Choices**: For types like number, integer, string, define choices with name and value.

Full command name is assembled from **Command**, **Subcommand Group** and **Subcommand**, like this: **/command subcommand-group subcommand**. If you leave Subcommand Group empty it looks like this: **/command subcommand**. If you leave both Subcommand Group and Subcommand empty it looks like this: **/command**. Options are added after full command name.

**Variables**

1. **User**: User who executed the command.
2. **Channel**: Channel where the command was executed.
3. **Interaction**: Interaction object from the command execution.
4. **Options**: Options that you specify in configuration.

**Usage**&#x20;

Creates interactive and dynamic chat commands with customizable subcommands and options.

**Troubleshooting**&#x20;

Verify correct configuration of command, subcommands, and options for intended functionality.

{% hint style="warning" %}
There is a global rate limit of 200 application command creates per day, per guild. This limit is imposed by Discord API. Only primary command modifycations count against this limti. If you only modify subcommands, subcommand groups, parameters etc. of a command it will not count against this limit.
{% endhint %}

{% hint style="warning" %}
Global commands (when guild is left empty) can take up to an hour to propagate to users. You can try restarting your Discord client to try to update the commands for you immediately.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flexy.bot/modules/discord/triggers/chat-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
