# Creating simple chat command

Video tutorial is available:

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

Start by creating a new automation. Select **Chat Command** as trigger.

<figure><img src="/files/3aOs1uPhrPemE15YnYmg" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="/files/ZBM8rFmoiTsOqkXeN9dU" alt="" width="375"><figcaption></figcaption></figure>

* Optionally select your Guild / Server (if you don't select it, the command will be available to all guilds that contain your bot). Please note that if you don't select a guild, the command could take up to an hour to become available to everyone (that is due to the way Discord synchronizes commands)
* Enter name of the command (this is what you will be using in Discord when you type **/command-name**)
* Enter a **Description** (this is shown in Discord when selecting the command)
* Select **Permissions** that will be required to use the command (the command is available to everyone if no permissions are selected). You can also limit access to only Administrators and later assign roles to the command (you can only do this from within Server Settings in Discord - go to Server settings -> Integrations -> Bot name -> Commands)

<figure><img src="/files/bIh76dYLRNImsnNru0ml" alt="" width="375"><figcaption></figcaption></figure>

Now we can send a reply whenever someone uses this command. Click on **+** to add a step and select **Reply to interaction**. When a user uses the command we call that an interaction.

<figure><img src="/files/8743pfuLi7AOkBila4bW" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="/files/ajhqy8ersbIG5vxoBgqs" alt="" width="375"><figcaption></figcaption></figure>

Select **Trigger > Interaction** as Interaction.

<figure><img src="/files/rM6FX0Iaf6T3Z5URlCvH" alt=""><figcaption></figcaption></figure>

**Ephemeral** messages are only shown to the user that used the command. If you select **No**, the reply is seen by everyone that can access the channel where the user used the command.

Enter some text into the **Content** field and click **Create** button to create the automation.


---

# 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/tutorials/discord-getting-started-guide/creating-simple-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.
