# Slash Commands

More info: [Slash](/use/toolbox/discord/interactions/slash.md)

## Creating Slash Commands

This code creates a new slash command named 'say' which includes a string option called 'text'.

<figure><img src="/files/z9GZZOcj9lftoXfd6HHP" alt="" width="563"><figcaption></figcaption></figure>

## Receiving Slash Commands

Upon receiving the slash command, the bot will reply to the interaction with the provided option 'text', repeating the specified text string.

<figure><img src="/files/dL7VTEFfwCrMyd8rAjns" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="success" %}
:tada: Congrats! You learned how to create and receive slash commands.
{% endhint %}

***

## FAQ

### What is a sub-command?

<mark style="color:blue;">Subcommands</mark> organize your commands by specifying actions within a slash command. `ex: /role`` `<mark style="color:blue;">`add/edit/delete`</mark>

### What are slash options?

<mark style="color:blue;">Slash options</mark> are used to allow the user to specify additional information for the command. Some options are <mark style="color:blue;">`String, Integer, True/False, Attachments User or Role, Channel`</mark>

### How to delete slash commands?

See the block '<mark style="color:blue;">Create slash commands</mark>' as a "Overwrite global commands".  Removing a slash command, the module will ensure that unused commands are <mark style="color:blue;">`deleted`</mark> and new ones will be <mark style="color:blue;">`created`</mark>

### What are ephemeral interaction replies?

Input to Ephemeral field <mark style="color:blue;">TRUE</mark> - visible only to the author,    <mark style="color:blue;">FALSE</mark> - Visible to anyone.

<figure><img src="/files/xGGsuxGH3Kinxy19U7RF" alt=""><figcaption><p>Example of an interaction reply visible only to the author</p></figcaption></figure>


---

# 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.scratch-for-discord.com/use/tutorial/slash-commands.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.
