0.0.1 • Published 3 years ago
@fruko-gazoz/deneme v0.0.1
discord.js-commands-handler
About
A package to Sync your bot's Slash Commands and manage interactions
- Quickly registers new Slash Commands
- Auto deletes deleted Slash Commands
- Managing Interactions
Example Usage
Instaling discord.js-commands-handler
npm i discord.js-commands-handler
index.js (exemple)
const { Client, Intents } = require("discord.js")
const client = new Client({ intents: [Intents.FLAGS.GUILDS] })
const commands_handler = require("discord.js-commands-handler")
client.on("ready", () => {
console.log(`Logged in as ${client.user.tag}!`)
commands_handler(client, "commands")
})
client.login("token")
command file (commands/ping.js)
module.exports = {
name: "ping",
description: "Replies with Pong!",
//options: [] => interaction options (optional),
//guild: "" => guild id (optional),
execute (client, interaction, options) {
interaction.reply('Pong!')
}
}
0.0.1
3 years ago