Coder Social home page Coder Social logo

ctociojosh / slack-watson-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibm/slack-watson-bot

0.0 1.0 0.0 6.08 MB

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

License: Apache License 2.0

JavaScript 100.00%

slack-watson-bot's Introduction

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:

$ npm install
$ node 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:

$ npm install
$ node watson-facebook.js

slack-watson-bot's People

Contributors

nheidloff avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.