Skip to content

How to use it

Ayfri edited this page Jul 15, 2021 · 5 revisions

Installation

To install the command handler, install Node.js (in the latest LTS version) and then in a terminal run this command where you want your bot npm install --save advanced-command-handler. After, you create your main file and adds this into it :

Basic usage

You can see a basic usage, plus the list of optional properties:

const {CommandHandler} = require('advanced-command-handler');

CommandHandler.create({
	// Optionals :
	commandsDir: 'name of the dir',
	eventsDir: 'name of the dir',
	prefixes: ['!', 'coolPrefix '], // Mentionning the bot is also a valid default prefix
	owners: ['Discord IDs'],
});

CommandHandler.launch({
	token: 'YOUR TOKEN GOES HERE',
	// Optional :
	clientOptions: {
		// Client Options, see Discord.js#ClientOptions
	},
});

Advanced usage

You can see some advanced examples in this repo.
Updated to version 2.4.0.