botmaster icon indicating copy to clipboard operation
botmaster copied to clipboard

Add botmaster-rivescript package

Open jdwuarin opened this issue 8 years ago • 1 comments

https://www.rivescript.com/

jdwuarin avatar Feb 20 '17 12:02 jdwuarin

I'm not sure we need a package - I got Rivescript running within Botmaster by simply adding the following to app.js - it's super-simple to get working!

const RiveScript = require('rivescript');
const myBot = new RiveScript();
myBot.loadFile("hello.rive", loading_done, loading_error);

function loading_done (batch_num) {
    console.log("Batch #" + batch_num + " has finished loading!");
}

function loading_error (error) {
    console.log("Error when loading files: " + error);
}

botmaster.on('update', (bot, update) => {
    var reply = myBot.reply("local-user", update.message.text);
    bot.reply(update, reply);
}

duncsand avatar Mar 30 '17 20:03 duncsand