1.0.1 • Published 4 years ago

@toadless/command-handler v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

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

By Toadless

1.0.1

4 years ago

1.0.0

4 years ago