IBM/slack-watson-bot

Name: slack-watson-bot

Owner: International Business Machines

Description: Sample Bots for Slack and Facebook Messenger using IBM Watson and Botkit

Created: 2017-06-22 07:14:25.0

Updated: 2018-05-18 16:53:16.0

Pushed: 2017-11-15 16:18:23.0

Homepage:

Size: 6224

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Sample Bots for Slack and Facebook Messenger using IBM Watson and Botkit

This project contains sample code that shows how to build chatbots for Slack and Facebook Messenger that leverage IBM Watson Conversation and Botkit.

In order to provide the best possible user experience Slack buttons and Facebook Messenger quick replies are used. Slack messages can be defined via the Slack Message Builder. For the format of Facebook messages check out the documentation. The definitions of the Slack and Facebook messages are stored in the dialog definition.

The project also demostrates how to invoke REST APIs, for example to find current weather conditions via Weather Company Data. In order to do this, nodes in the dialog are marked as 'action nodes' via context information. The implementation of the actions is done in the Node.js application.

Check out the presentation for more details.

Serverless Web Apps

This screenshot shows a simple sample conversation in Slack:

alt text

This screenshot shows a simple sample conversation in Facebook Messenger:

alt text

Prerequisites and Setup

You need three different sets of credentials.

Put all of these credentials in a file '.env'. See .env-template for an example.

In addition to the Slack client id and secret additional configuration needs to be done for the Slack app. See the screenshots 'slack-config1-5.png' in the screenshots folder for details.

The Watson workspace needs to be imported into the Conversation service.

In order to run the application locally, you can use tools like localtunnel.

If you want to deploy the application to Bluemix, you need a Bluemix account. Sign up if you don't have an account yet.

Run the Sample

From the root directory run these commands to start the Slack bot:

m install
de watson-slack.js

Open up the login page http://localhost:3000/login to add the bot to the team. After this you can send direct messages to the bot 'watson-bot' in your Slack team.

From the root directory run these commands to start the Facebook Messenger bot:

m install
de watson-facebook.js

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.