djs-easy-command

A simple and easy to use Discord.js Command Handler

this package has been deprecated
Last updated 10 months ago by warhammer414 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install djs-easy-command 
SYNC missed versions from official npm registry.

djs-easy-command

A simple and easy to use Discord.js Command Handler

Installation

npm install djs-easy-command

Setup

  1. Start by requiring the required modules and creating the discord client and command handler with the command directory, prefixes, owners and disabled commands.
const Discord = require('discord.js');
const Client = new Discord.Client();
const { Handler } = require('djs-easy-command');
Client.Handler = new Handler(Client, {
	directory: `${__dirname}/commands/`,
	prefixes: [ '!', '!!' ],
	owners: [ '289232137570222083' ],
	disabled: []
});
Client.login('token')
  1. Now create the commands folder in the bot directory and a command inside of it, we're going to add this to it. All of the options aren't required but you do need to have the name else it'll stop the bot with an error saying the command doesn't have a name.
const { Command } = require('djs-easy-command')
class TestCommand extends Command {
	constructor(){
		super({
			name: 'test',
			aliases: [ 'testing' ],
			description: 'A test command',
			category: 'fun',
			usage: 'test',
			owner: false,
			nsfw: false,
			disabled: false
		})
	}
	async run(msg, args, Client) {
		return msg.reply('testing!')
	}
}
module.exports = TestCommand
  1. That's it!, your all done. Additionally there's default commands, eval, help, and ping, eval is only usable by the owner(s).

Current Tags

  • 1.1.1                                ...           latest (10 months ago)

6 Versions

  • 1.1.1 [deprecated]           ...           10 months ago
  • 1.1.0 [deprecated]           ...           10 months ago
  • 1.0.3 [deprecated]           ...           a year ago
  • 1.0.2 [deprecated]           ...           a year ago
  • 1.0.1 [deprecated]           ...           a year ago
  • 1.0.0 [deprecated]           ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 3
Dependencies (6)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |