Node module for Botlytics API.
Visit the official HTTP docs here
npm install botlytics
var botlytics = require('botlytics');
var bot_token =""; // Include your bot token here.
botlytics.setBotToken(bot_token);
This sets the bot token for our function calls.
botlytics.incoming(<message>,<conversation_id>, function(err, response, body){} );
botlytics.outgoing(<message>,<conversation_id>, function(err, response, body){} );
var botlytics = require('botlytics');
botlytics.setBotToken('XXXXXXXXXXXX');
botlytics.incoming("Hello!","test_user", function(err,res, body){
if(err) throw Error(err);
console.log(body);
});
This outputs :
{
"text": "Hello!",
"kind": "incoming",
"created_at": "2016-05-07T04:42:58.129Z"
}
npm test
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.