new BaseHandler(data)
Construct a Handler
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | The handler data |
Properties:
| Name | Type | Attributes | Default | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
data.agent |
Agent |
<optional> |
The agent managing the bot |
|||||||||
data.client |
Eris.Client | The Eris client |
||||||||||
data.options |
Object |
<optional> |
{} | Additional options for the command handler Properties
|
Members
-
private _agent : Agent
-
The agent managing the bot
-
private _app : Object
-
The Discord app of the bot
-
private _client : Eris
-
The Eris client
Methods
-
private _getApp() → {Promise<Object>}
-
Get the bot's app data and store it in
this.appReturns:
Promise<Object> -The app data
-
async, private _sendResponse(channel, msgData) → {Promise<Eris.Message>}
-
Send a response to Discord
Parameters:
Name Type Description channelEris.TextChannel The channel to send the response to
msgDataObject The data for the response message
Returns:
Promise<Eris.Message> -The resulting response or a returned error of minor reasons why the response failed
Properties:
Name Type Attributes Description msgData.contentString <optional>
The response content
msgData.embedObject <optional>
The response embed
msgData.fileObject <optional>
The response file
Properties
Name Type Attributes Description nameString <optional>
The name of the file
fileBuffer <optional>
The file content
-
validateChannel(channel) → {Boolean}
-
Check that a channel is valid to send a message to (Minimizes bad requests and reduces ratelimiting)
Parameters:
Name Type Description channelEris.Channel The channel to verify
Returns:
Boolean -Whether a message can be sent to the channel or not