> 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/examples.md).

# Examples

Below is an example command in JavaScript, TypeScript and CoffeeScript

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

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

const { MessageEmbed } = require("discord.js");

module.exports = {
  name: "ping",
  aliases: ["Pong"],
  description: "Replies with Pong!",
  cooldown: "5s",
  cooldownMessage: "Wait {REMAINING} more to execute this command again!",
  //usage: "", it's not needed on this command
  //example: "", it's not needed on this command
  minArgs: 0,
  maxArgs: 0,
  argsMessage:
    "Incorrect Arguments! There are no arguments required for this command!",
  dev: true,
  devMessage: "You must be a developer to run this command!",
  nsfw: true,
  nsfwMessage: "You cannot run this command in SFW channels!",
  permissions: ["KICK_MEMBERS"],
  permissionsMessage:
    "You must have the 'Kick Members' permission to run this command!",
  botPermissions: ["EMBED_LINKS"],
  botPermissionsMessage:
    "I cannot run this command without the 'Embed Links' permission!",
  category: "Misc",
  locked: true,
  lockedMessage: "This command is locked at the moment!",
  hidden: true,
  hidden2: true,
  servers: ["769710808435261490"],
  serversMessage: "Use this command in CDHandler support server!",
  run: ({ message, args, client, handler }) => {
    /* handler represents CDHandler but don't change the param name you can use callback, execute or fire instead of run */
    const embed = new MessageEmbed().setColor("#00DCFF").setTitle("Pong!");

    message.channel.send(embed);

    handler.cooldown(message, "5s"); // this creates a cooldown
  },
};
```

{% endtab %}

{% tab title="TypeScript" %}

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

import { MessageEmbed } from "discord.js";

export default {
  name: "ping",
  aliases: ["Pong"],
  description: "Replies with Pong!",
  cooldown: "5s",
  cooldownMessage: "Wait {REMAINING} more to execute this command again!",
  //usage: "", it's not needed on this command
  //example: "", it's not needed on this command
  minArgs: 0,
  maxArgs: 0,
  argsMessage:
    "Incorrect Arguments! There are no arguments required for this command!",
  dev: true,
  devMessage: "You must be a developer to run this command!",
  nsfw: true,
  nsfwMessage: "You cannot run this command in SFW channels!",
  permissions: ["KICK_MEMBERS"],
  permissionsMessage:
    "You must have the 'Kick Members' permission to run this command!",
  botPermissions: ["EMBED_LINKS"],
  botPermissionsMessage:
    "I cannot run this command without the 'Embed Links' permission!",
  category: "Misc",
  locked: true,
  lockedMessage: "This command is locked at the moment!",
  hidden: true,
  hidden2: true,
  servers: ["769710808435261490"],
  serversMessage: "Use this command in CDHandler support server!",
  run: ({ message, args, client, handler }: any) => {
    /* handler represents CDHandler but don't change the param name
     you can use callback, execute or fire instead of run */
    const embed = new MessageEmbed().setColor("#00DCFF").setTitle("Pong!");

    message.channel.send(embed);

    handler.cooldown(message, "5s"); // this creates a cooldown
  },
};// File Name - ping.ts
```

{% endtab %}

{% tab title="CoffeeScript" %}

```coffeescript
# File Name - ping.coffee

{ MessageEmbed } = require("discord.js");

module.exports = {
  name: "ping"
  aliases: ["Pong"]
  description: "Replies with Pong!"
  cooldown: "5s"
  cooldownMessage: "Wait {REMAINING} more to execute this command again!"
  # usage: "", it's not needed on this command
  # example: "", it's not needed on this command
  minArgs: 0
  maxArgs: 0
  argsMessage:
    "Incorrect Arguments! There are no arguments required for this command!"
  dev: true
  devMessage: "You must be a developer to run this command!"
  nsfw: true
  nsfwMessage: "You cannot run this command in SFW channels!"
  permissions: ["KICK_MEMBERS"]
  permissionsMessage:
    "You must have the 'Kick Members' permission to run this command!"
  botPermissions: ["EMBED_LINKS"]
  botPermissionsMessage:
    "I cannot run this command without the 'Embed Links' permission!"
  category: "Misc"
  locked: true
  lockedMessage: "This command is locked at the moment!"
  hidden: true
  hidden2: true
  servers: ["769710808435261490"]
  serversMessage: "Use this command in CDHandler support server!"
  run: ({ message, args, client, handler }) -> 
    # handler represents CDHandler but don't change the param name you can use callback, execute or fire instead of run 
    embed = new MessageEmbed().setColor("#00DCFF").setTitle("Pong!");

    message.channel.send embed

    handler.cooldown(message, "5s"); # this creates a cooldown
  
};
```

{% endtab %}
{% endtabs %}
