@toadless/command-handler

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @toadless/command-handler

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

10.1 kB

Total Files

12

Last publish

Collaborators

  • toadless