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-commandsFeatures
- 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");