I presented at a tech talk at Howard University earlier this month on how to build chatbots using Slack developer platform tools and botkit framework. This talk discusses early disruptors in bot industry, slack bot project configuration setup deployment, integrating an external API in the bot followed by an example of a custom bot built for PayPal Platforms team.
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 Slack’s 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
https://api.slack.com/events
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) https://github.com/slackhq/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
• http://howdy.ai/botkit
Using Botkit to develop a custom Bot using Slack RTM API.
10. Developing a Custom SlackBot - Setup
1. Install Botkit
• From NPM
• npm install --save botkit
• From Github
• git clone
git@github.com:howdyai/botkit.git
• npm install
2. Create a new bot user integration and
customize it
https://my.slack.com/services/new/bot
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