This repository has been archived by the owner on Jul 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commands
Nitrous edited this page Jan 28, 2018
·
14 revisions
Commands are used to instantiate a task. To create a new command, make a new JavaScript file under commands
directory with the file name being the command's name.
From example.js
module.exports = {
name: 'Example',
desc: 'Example Command',
help: 'Example Command',
args: [''],
preq: [''],
perm: [''],
run: (bot, msg, args) => {
msg.channel.send('Hello World!');
}
}
Key | Value Type | Value Description |
---|---|---|
name |
String | Name to be displayed. |
desc |
String | Description to be displayed. |
help |
String | Full help text to be displayed in "help" command. |
args |
String Array | Arguments to be displayed. |
preq |
String Array | Prerequisites required to run command. |
perm |
String Array | Permissions required to run command. |
run |
Function | The command's run action. |
The run action receives 3 arguments:
-
bot
- The bot instance being run -
msg
- The Message Object -
args
- The arguments in String Array being passed down from a command