Sorta like a brain for your Corrade bot.
That's a good question!
Node Corrade is built using Promises everything should resolve or reject back to your main file.
- REGISTERED_MODULES :
Object
Object containing registered modules.
Kind: global class
- Corrade
- new Corrade(config)
- instance
- inner
Create an object that will interact with your corrade bot.
Param | Type | Description |
---|---|---|
config | object |
Configuration options needed to establish a TCP connection with the corrade bot. |
config.protocol | string |
The protocol that you will use: http, https. |
config.host | string |
fqdn hostname or ip where the corrade bot is. |
config.port | number |
The port the tcp connection is on. |
config.group | string |
Second Life group name. |
config.password | string |
Second Life Corrade group password. |
config.types | array |
array of notification types you will subscribe to. |
config.basicAuth | object |
http basic auth credentials. |
config.basicAuth.user | string |
http basis auth username. |
config.basicAuth.password | string |
http basic auth password. |
Example
let config = {};
config.host = 'bot.example.com';
config.protocol = 'https';
config.group = 'MyGroupHere';
config.password = 'SuperAwesomeStrongPassword';
config.basicAuth = {
user: 'corrade',
password: 'Somepassword'
};
config.port = 9000;
config.types = ['group', 'message', 'statistics'];
let Corrade = require('./corrade.js');
let corrade = new Corrade(config);
Snowball event.
Kind: event emitted by Corrade
Properties
Name | Type | Description |
---|---|---|
parsedDate | string |
returns data that is emitted from the tcp Interface. |
Kind: inner method of Corrade
Returns: Promise
- parsedData - returns a promise object which will contain querystring parsed data, is csv format.
Param | Type | Description |
---|---|---|
options | object |
case specific options needed to send a http(s) query to corrade. |
autoEscape | boolean |
querystring escape all contents of the options object. |
Example
corrade.query({
command: 'tell',
entity: 'avatar',
agent: '<agent uuid>',
message: 'Some Text Here'
}, false);
Kind: inner method of Corrade
Param | Type | Description |
---|---|---|
modules | array |
array of modules to load. |
authorizedRoles | array |
array of authorized group roles from your second life group that have access to this module. |
allowedTypes | array |
notification types this belongs to. |
Example
corrade.loadModules([ban], ['Staff', 'Owners'], ['message']);
Kind: inner method of Corrade
Returns: Promise
- returns a promise object which will contain the data of the registered function after it runs.
Param | Type | Description |
---|---|---|
moduleName | string |
string name of the registered module. |
params | object |
object of data for the module to run. |
Example
corrade.loadModules([ban], ['Staff', 'Owners'], ['message']);
Kind: inner method of Corrade
Returns: Promise
- returns a promise object which will contain a csv of names unless any one of the names do not match.
Param | Type | Description |
---|---|---|
arrayOfNames | array |
array of legacy names or partial names. |
Example
corrade.corradeGetGroupMembersByName(['bunny','bob','sunny']).then(function (res) {
//do things
});
Kind: inner method of Corrade
Returns: Promise
- returns a promise object which will contain the full name unless it does not match anyone in the group.
Param | Type | Description |
---|---|---|
singleName | string |
single legacy name or partial name. |
Example
corrade.corradeGetGroupMembersByName('bunny').then(function (res) {
//do things
});
expects the initial message from corrade (ater its been trasformed though querystring) to go into this function then formats the data to be more javascript friendly if the first part of the message string is a command.
Kind: inner method of Corrade
Returns: Promise
- returns a promise object which will contain the firstName, lastName, messageAsString, messageAsArray, command, uuid, and type paramaters.
Param | Type | Description |
---|---|---|
data | object |
corrade data object. |
Example
corrade.corradeGetGroupMembersByName('bunny').then(function (res) {
//do things
});
Object containing registered modules.
Kind: global variable