discord-slash-commands
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

discord-slash-commands

Slash commands for Discord

Installation

npm i discord-slash-commands

Features

  • Customizable
  • Multiple commands support
  • Per-guild commands support

Example

const Discord = require('discord.js');
const client = new Discord.Client();

const { Slash } = require('discord-slash-commands');
const slash = new Slash(client);

client.on("ready", () => {
    console.log("Ready");
    
    const em = new Discord.MessageEmbed()
    .setTitle("Test");

    slash.command({
        guildOnly: true,
        guildID: "GUILD_ID",
        data: {
            name: "ping",
            description: "Ping pong?",
            type: 4,
            content: `Pong! \`${client.ws.ping}ms\``
        }
    })
    slash.command({
        guildOnly: true,
        guildID: "GUILD_ID",
        ephemeral: true,
        data: {
            name: "ephemeral",
            description: "Send an ephemeral message",
            type: 4,
            content: `Hey!`
        }
    })
    slash.command({
        guildOnly: true,
        guildID: "GUILD_ID",
        data: {
            name: "embed",
            description: "Send an embed",
            type: 4,
            content: `Hey!`,
            embeds: [em]
        }
    })
})

client.login("TOKEN");

Need help? Join the Support Server

© shadeoxide | Shade's Workshop - 2020

Package Sidebar

Install

npm i discord-slash-commands

Weekly Downloads

51

Version

1.2.4

License

MIT

Unpacked Size

6.73 kB

Total Files

5

Last publish

Collaborators

  • shadeoxide