Building Enterprise Chat Bots

Download Building Enterprise Chat Bots

Post on 28-Jan-2018




0 download


1. Building Chat Bots !! 2. What is a Chatbot, Slack, SlackBot .. Chatbot A Chatbot is a computer program which conducts a conversation via audio or textual methods. E.g. Voice based bots : Alexa, Siri Text based chat bots: Slack, Facebook, Skype. Slack Slack is a cloud-based messaging app for team collaboration. Got very popular due to app integrations. Slack teams consist of channels, users (humans and bots) Similar Instant messenger platforms are Skype, Facebook Messenger, Whatsapp SlackBot ?? 2017 PayPal Inc. Confidential and proprietary. 3. Bot Platform to order from marketplacess. TacoBot within the Slack Twitter Bot to order Pizza by Tweeting Pizza Emoji Early disruptors in bots domain 4. PayPal announced their own Slackbot in early 2017 for to use PayPal within Slack. Followed by PayPal in 2017.. 5. What can a Slackbot do Slack Bot interact with a user on a Slack team by 1. Connecting to Slacks Real time Messaging (RTM )API and opening a web-socket connection with Slack. Bot user will Monitor and process channel activity Post messages and react to users Web API to post formatted messages, attachments, emoji Make messages interactive with buttons 2. Listening to Slack Events via HTTP based Events API aka Slack Webhooks . Configure events at 6. Developing a SlackBot Two Kinds of Slack bot you can develop : Custom Bots Custom for a teams requirements Can be used for companys process automation etc. Bot Users attached to Slack App For distribution to other teams Governed by OAuth permission scopes Distributed via Slack Button or Slack Appstore Apps generally start as custom bots and evolve into a Slack App. 2017 PayPal Inc. Confidential and proprietary. 7. Programming a Slack bot 1. Make authenticated API calls and consume Slack RTM API 2. Use existing library or SDKs (such as node-slack- client) 3. Botkit Framework : Does heavy lifting for Slack API interaction Open source bot builder platform for Node.js Targets Slack, Facebook, Twilio currently Using Botkit to develop a custom Bot using Slack RTM API. 8. CODE WALKTHROUGH 9. Project Structure Clone: node_modules/ contain botkit module generated by npm install package.json specifies your project details and dependencies index.js is the entry point Util.js for utility functions Config.json for string sensitive data Npm-debug.log created by default for error logging Lib/ directory containing slack libraries 2017 PayPal Inc. Confidential and proprietary. 10. Developing a Custom SlackBot - Setup 1. Install Botkit From NPM npm install --save botkit From Github git clone npm install 2. Create a new bot user integration and customize it 11. Developing a Custom SlackBot Hello World 3. Capture token generated in #1, to be used to connect to Slack API 4. Constructs base 64 encoded value and add it to config.json (not mandatory for regular bots) 5. Run a sample bot npm start index.js 6. Invite Bot to your team 7. Say Hello to your Bot 12. Lets Integrate an API in our bot 1. API to integrate Github 2. Get tokens and make first successful API call 3. Convert REST Call into Node Code 4. Write a controller using Intents from Slack input and parsing them for API call 5. Integrate Node code 6. Parse API Response and construct Slack Response 7. Happy Bot-ing !! 2017 PayPal Inc. Confidential and proprietary. 13. Demo for GitBit !! & Questions 14. Thank You !! 15. service.png ftDoHNGEvuMQiuWLA.jpeg featured1.jpg https://cdn-images-*SRq8BmUQl1YWXTCbO859kw.png content/uploads/2016/03/Hero_graphic_BeepBoop@2x.png ng Image Credits