JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 91
  • Score
    100M100P100Q77971F
  • License MIT

Slash commands for Discord

Package Exports

  • discord-slash-commands

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (discord-slash-commands) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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