Constructor
new Bot(options)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
Methods
handle(data, passedUrl, route, res)
Handles the data received from the API
Parameters:
Name | Type | Description |
---|---|---|
data |
string | The body supplied by the API |
passedUrl |
string | URL supplied by the API |
route |
string | The request's route |
res |
ServerResponse | Response to be sent to the API |
listen(port, host)
Invokes the server's listen method
Parameters:
Name | Type | Description |
---|---|---|
port |
number | Port to listen on |
host |
string | Hostname for the server |
- Source:
- See:
register(handler, optionsopt)
Register handler
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
handler |
Handler | Handler object |
|||||||||
options |
object |
<optional> |
options for registering Properties
|
send(method, update, callback, optionsopt)
Sends an update to the API
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
method |
string | Is appended to the API's URL |
|||||||||||||
update |
object | The update object that should be sent |
|||||||||||||
callback |
Bot~response | Callback containing error, response and body |
|||||||||||||
options |
object |
<optional> |
Options object Properties
|
Type Definitions
response(error, response, body)
Callback containing the API's response data
Parameters:
Name | Type | Description |
---|---|---|
error |
object | |
response |
object | |
body |
String |