1.1.1 • Published 8 years ago

api-ai-botkit v1.1.1

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

api-ai-botkit

npm

Utility lib for creating bots. So far only tested with Slack.

For usage sample code see examples/sample_bot.js

Steps for using lib

Install library from npm

npm install --save api-ai-botkit

Import Library

const apiaibotkit = require('api-ai-botkit');

Create apiai object using token from http://api.ai website

const apiai = apiaibotkit(apiaiToken);

Use apiai object in controller.hears

controller.hears('.*', ['direct_message', 'direct_mention', 'mention'], function (bot, message) {
    apiai.process(message, bot);
});

Implement different reactions to appropriate actions

apiai
    .action('smalltalk.greetings', function (message, resp, bot) {
        var responseText = resp.result.fulfillment.speech;
        bot.reply(message, responseText);
    })
    .action('input.unknown', function (message, resp, bot) {
        bot.reply(message, "Sorry, I don't understand");
    });
1.1.1

8 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago