|
| 1 | +# Command |
| 2 | +Represents a Command |
| 3 | + |
| 4 | +## Properties |
| 5 | +.client |
| 6 | +> Client that is attached to the command\ |
| 7 | +> type [CommandClient](https://github.com/Forbidden-Duck/eris.js-commando/tree/master/docs/Classes/CommandoClient.md) |
| 8 | +
|
| 9 | +.name |
| 10 | +> Name of the command\ |
| 11 | +> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| 12 | +
|
| 13 | +.group |
| 14 | +> Group the command belongs to\ |
| 15 | +> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | [Group](https://github.com/Forbidden-Duck/eris.js-commando/tree/master/docs/Classes/Group.md) |
| 16 | +
|
| 17 | +.optionsUsed |
| 18 | +> Options used on the command\ |
| 19 | +> type [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) |
| 20 | +
|
| 21 | +.description |
| 22 | +> Description of the command\ |
| 23 | +> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| 24 | +
|
| 25 | +.usage |
| 26 | +> Usage of the command\ |
| 27 | +> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| 28 | +
|
| 29 | +.aliases |
| 30 | +> An array of command aliases\ |
| 31 | +> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[] |
| 32 | +
|
| 33 | +.guildOnly |
| 34 | +> If the command is guild only\ |
| 35 | +> type [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) |
| 36 | +
|
| 37 | +.ignoreBots |
| 38 | +> If the command should ignore bots\ |
| 39 | +> type [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) |
| 40 | +
|
| 41 | +.queues |
| 42 | +> An object mapping all queues\ |
| 43 | +> preCommand? [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)\ |
| 44 | +> postCommand? [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)\ |
| 45 | +> type [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) |
| 46 | +
|
| 47 | +.requires |
| 48 | +> An object mapping all command requirements\ |
| 49 | +> userIDs? [User](https://abal.moe/Eris/docs/User)[]\ |
| 50 | +> roleIDs? [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[]\ |
| 51 | +> permissions? [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[]\ |
| 52 | +> type [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) |
| 53 | +
|
| 54 | +.invalidRequireMSG |
| 55 | +> Message to send when a requirements fails\ |
| 56 | +> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| 57 | +
|
| 58 | +## Constructor |
| 59 | +`new Commando.Command(client, name, group, options, execute)` |
| 60 | +> Parameter | Default | Description | Type |
| 61 | +> --------- | ------- | ----------- | ---- |
| 62 | +> client | | Client that is attached to the command | [CommandClient](https://github.com/Forbidden-Duck/eris.js-commando/tree/master/docs/Classes/CommandoClient.md) |
| 63 | +> name | | Name of the command | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| 64 | +> group | | Group the command belongs to | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| 65 | +> options? | {} | All optional, Object mapping command options | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) |
| 66 | +> options.description? | "No description" | Description of the command | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| 67 | +> options.usage? | "No usage" | Usage of the command | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| 68 | +> options.aliases? | [] | An array of command aliases | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[] |
| 69 | +> options.guildOnly? | false | If the command is guild only | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) |
| 70 | +> options.ignoreBots? | true | If the command should ignore bots | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) |
| 71 | +> options.queues? | {} | An object mapping command queues | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) |
| 72 | +> options.queues.preCommand? | | Executed before the command | [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) |
| 73 | +> options.queues.postCommand? | | Executed after the command | [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) |
| 74 | +> options.requires? | {} | Object mapping all command requirements | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) |
| 75 | +> options.requires.users? | [] | An array of Users | [User](https://abal.moe/Eris/docs/User)[] |
| 76 | +> options.requires.roleIDs? | [] | An array of Role IDs | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[] |
| 77 | +> options.requires.permissions? [] | An array of permissions | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[] |
| 78 | +> options.invalidRequireMSG? | | Message to send if the requirements check fails | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) |
| 79 | +> execute? | undefined | Function to be executed | [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)> \| [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) |
| 80 | +
|
| 81 | +## Functions |
| 82 | +execute(message, args) |
| 83 | +> Executes when the command is finished processing |
| 84 | +> Parameter | Description | Type |
| 85 | +> --------- | ----------- | ---- |
| 86 | +> message | Message the command originated from | [Message](https://abal.moe/Eris/docs/Message) |
| 87 | +> args | An array of arguments | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[] |
0 commit comments