discord-slash-commands
v1.2.4
Published
Slash commands for Discord
Downloads
49
Maintainers
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");