Constructor
(abstract) new AbstractCommand()
Creates a new AbstractCommand
Members
(abstract) description :String
A description of the command
Type:
- String
(abstract) name :String
The name of the command
Type:
- String
Methods
(private) _sendMessage(channel, content, optionsopt) → {Promise.<Message>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channel |
Channel |
The channel to create the message in |
|
content |
String | Object |
The content to be passed to Eris.Client#createMessage |
|
options |
Object | <optional> |
Options for sending the message |
Returns:
The sent message
- Type
- Promise.<Message>
awaitMessage(trigger, action, timeoutopt) → {Number}
Await a message, the trigger a function
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
trigger |
function |
A function that takes a Message and returns a Boolean |
|
action |
function |
A function to be executed when |
|
timeout |
Number | <optional> |
Delete the await after this many milliseconds |
Returns:
The unique id of the await
- Type
- Number
destroy() → {Promise}
Destroys/unloads the command
Returns:
Resolves with no value
- Type
- Promise
escapeMarkdown(text) → {String}
Escape any discord markdown present in a string
Parameters:
Name | Type | Description |
---|---|---|
text |
String |
The text to escape |
Returns:
The escaped text
- Type
- String
load(parent) → {Promise}
Loads the command
Parameters:
Name | Type | Description |
---|---|---|
parent |
AbstractCommandPlugin |
The plugin managing this command |
Returns:
Resolves with this
- Type
- Promise
sendMessage(message, content, optionsopt) → {Promise.<Message>}
Send a message to discord
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
message |
Message |
The message to respond to |
|||||||||||||||||||||||||||||||
content |
String | Object |
The content to be passed to Eris.Client#createMessage |
|||||||||||||||||||||||||||||||
options |
Object | <optional> |
Options for sending the message Properties
|
Returns:
The sent message, or nothing if pagination is true
- Type
- Promise.<Message>
userOnCooldown(userID, waitTime) → {Boolean}
Check if a user is on cooldown
Parameters:
Name | Type | Description |
---|---|---|
userID |
String |
The id of the user to check for |
waitTime |
Number |
If not on cooldown, put them on cooldown for this many milliseconds |
Returns:
If the user is still on cooldown
- Type
- Boolean