1.0.1 • Published 3 years ago
light-commander v1.0.1
LightCommander
Installation
npm install light-commander
Setup
const lightCommander = require("light-commander");
const { Client, Intents } = require("discord.js");
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
client.on("ready", () => {
new lightCommander.CommandHandler()
.setCommandsDir(`commands`)
.setDefaultPrefix(`!`)
.ignoreBots(true)
.registerCommands()
})
Creating Commands
const { Command } = require("light-commander");
module.exports = new Command()
.setName("ping")
.setDescription("Ping pong command.")
.setCallback((message, args, client) => {
message.channel.send(`Pong!`);
});