1.4.2 • Published 8 years ago

iopa-bot-console v1.4.2

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
8 years ago

IOPA iopa-bot-console

NPM NPM

NPM

About

This repository contains a connector the for terminal console for the IOPA Bot Framework.

It is typically used only in localhost testing.

Example Usage

const iopaBotFramework = require('iopa-bot'),
      iopa = require('iopa'),
      BOT = iopaBotFramework.constants.BOT;

require('iopa-bot-console');

var app = new iopa.App();

app.use(iopaBotFramework.connectors.console);
app.use(iopaBotFramework);

// conversation schema -- change to program your bot

app.intent(BOT.INTENTS.Launch, { "utterances": ['/launch', '/open'] })

app.dialog('/', [BOT.INTENTS.Launch], function(context, next) {
    context.response.say("Hello!  Please converse with this bot. ").send();
});

app.intent('helloIntent', { "utterances": ['hi', 'hello', 'hey'] }, function(context, next) {
     context.response.say("Hello World").send();
})

app.dialog('/unknown', '*', function(context, next) {
    context.response.say("I don't know what you mean by " + context[BOT.Text]).send();
});

// build and listen to console

app.build();
app.listen();

License

Apache-2.0

API Reference Specification

IOPA