Discord-Command-Handler
Usage
App.JS
const Discord = require('discord.js')
const client = new Discord.Client()
client.login('TOKEN')
const Command = require('@toadless/command-handler')
client.on('ready', () => {
console.log('ready...')
new Command(client, './commands', '!')
})
Command File
module.exports.run = async (bot, message, args) => {
//Do stuff
}
module.exports.help = {
name: 'COMMAND-NAME' //Command Name
}
Make sure that your command file is the same name as the command. Also make sure that your commands are in a folder called commands.
You can also listen for a prefix checked event:
client.on('cmd-message', msg => {})
this is a prefix checked message eve