All Projects → dialogflow → Dialogflow Botkit Client

dialogflow / Dialogflow Botkit Client

Licence: apache-2.0
Botkit library for Dialogflow

Programming Languages

javascript
184084 projects - #8 most used programming language

DEPRECATED api-ai-botkit

Deprecated
This Dialogflow client library and Dialogflow API V1 have been deprecated and will be shut down on October 23th, 2019. Please migrate to Dialogflow API V2 and the v2 client library

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");
    });

License

See LICENSE.

Terms

Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the Google APIs Terms of Service.

This is not an official Google product.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].