> For the complete documentation index, see [llms.txt](https://creativedevelopments.gitbook.io/cdhandler/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://creativedevelopments.gitbook.io/cdhandler/using-cdhandler/commands/slash-commands.md).

# Slash Commands

Slash commands are a new feature implemented into Discord and CDHandler, so they can have some "bugs"

## Slash Command Options

* **name** - \[String] | Command name
* **slash** - \[Boolean or String] | false deletes the command, true creates the command, "Both" makes it a slash command and a normal command.
* **data** - \[Array with objects] | the options for the slash command servers - Array | List of guilds where the slash command will be created
* **description** - \[String] | The command description&#x20;
* **usage** - \[String] | The command usage&#x20;
* **example** - \[String] | A example
* **category** - \[String] | The category the command is in
* **hidden** - \[Boolean] | Makes the command completely invisible for help command
* **hidden2** - \[Boolean] | Makes the command partially invisible for help command

## Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
// File Name - ping.js

const { MessageEmbed } = require('discord.js')

module.exports = {
    name: "ping",
    slash: true,
    servers: ['814832821125775420'],
    description: "poggers",
    run: ({ message, args, client, handler, interaction }) => {
            
        return "Pong!" // message which will be sent, always include return to don't crash
   },
};
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
// File Name - ping.ts

import { MessageEmbed } from 'discord.js'

export default {
    name: "ping",
    slash: true,
    servers: ['814832821125775420'],
    description: "yo cannon is cool",
    run: ({ message, args, client, handler, interaction }: any) => {
            
        return "Pong!" // message which will be sent, always include return to don't crash
   },
};
```

{% endtab %}

{% tab title="CoffeeScript" %}

```coffeescript
# File Name - ping.coffee

{ MessageEmbed } = require('discord.js')

module.exports = {
    name: "ping"
    slash: true
    servers: ['814832821125775420']
    description: "yo cannon is cool"
    run: ({ message, args, client, handler, interaction }) ->
            
        return "Pong!" # message which will be sent, always include return to don't crash
};
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
The message property isn't a discord.js Message object, it is just a small object with Guild object, Channel object, Member object and User object
{% endhint %}
