iopa-bot-console

1.4.2 • Public • Published

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

Package Sidebar

Install

npm i iopa-bot-console

Homepage

iopa.io

Weekly Downloads

0

Version

1.4.2

License

Apache-2.0

Last publish

Collaborators

  • nodekit-io