Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Your First Slack Bot Service
@dblockdotorg
http://www.meetup.com/New-York-Slack-Meetup/
March 10, 2016
dB.
there’s a bottleneck in the db query
the db is down
did you set the correct db credentials?
mongo db
Q?
deferred?
reject?
accept?
Integration Overview
Web API
Real Time Messaging API
Slack Platform Services

Clients
Frameworks
Integrations
Incoming Webhook

a way to send (but not receive) messages to Slack
Outgoing Webhook
a way to receive message...
/Launch Platform
Slack App
web app

published in slack app directory
has a slack button that redirects to slack
slack returns a token
app s...
Code
https://github.com/dblock/your-first-slack-ruby-bot-in-ruby
Incoming Webhook

a way to send (but not receive) messages...
Clients
https://api.slack.com/community
https://github.com/slackhq/node-slack-client
Slack-Node-Client
var client = require('../lib/clients/web/client');
client.c...
client = Slack::Web::Client.new(token: token)

client.chat_postMessage(channel: '#general', text: 'Hello World’)
https://g...
https://github.com/slackhq/node-slack-client
Slack-Node-Client
var client = require(‘@slack/client').RtmClient;
var rtm = ...
client = Slack::RealTime::Client.new(token: token)
client.on :message do |data|
case data.text
when 'bot hi' then
client.m...
https://github.com/slackhq/node-slack-client
https://github.com/dblock/slack-ruby-client
Local Store
rtm.start

channels, ...
https://github.com/howdyai/botkit
supports all slack APIs
hears what is said in Slack
replies to what is said in Slack
sup...
https://github.com/dblock/slack-ruby-bot
real-time and web apis only
commands
operators
regex matchers
events
Slack-Ruby-B...
market.playplay.io
api-explorer.playplay.io
playplay.io
leaderboards
challenges
matches
seasons
GIFs


shell.playplay.io
playplay.io
stats

266 active teams
3971 games played
996 players
dev
ruby grape
mongodb
slack-ruby-*
ops
from Heroku to D...
What to build?
Find what people already do at work all day long.
Make a bot that helps a team collaborate around that.

Pr...
@dblockdotorg
Your First Slack Bot Service (NYC Slack Meetup)
Your First Slack Bot Service (NYC Slack Meetup)
Your First Slack Bot Service (NYC Slack Meetup)
Your First Slack Bot Service (NYC Slack Meetup)
Your First Slack Bot Service (NYC Slack Meetup)
Your First Slack Bot Service (NYC Slack Meetup)
Your First Slack Bot Service (NYC Slack Meetup)
Your First Slack Bot Service (NYC Slack Meetup)
Upcoming SlideShare
Loading in …5
×

Your First Slack Bot Service (NYC Slack Meetup)

1,124 views

Published on

Watch the video instead: https://vimeo.com/158686783
Slack API integration basics, including Web Hooks, Web and Real Time APIs.
Live coding of a complete Slack bot service with Slack Button integration, in Ruby.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Your First Slack Bot Service (NYC Slack Meetup)

  1. 1. Your First Slack Bot Service @dblockdotorg http://www.meetup.com/New-York-Slack-Meetup/ March 10, 2016
  2. 2. dB. there’s a bottleneck in the db query the db is down did you set the correct db credentials? mongo db
  3. 3. Q? deferred? reject? accept?
  4. 4. Integration Overview Web API Real Time Messaging API Slack Platform Services
 Clients Frameworks
  5. 5. Integrations Incoming Webhook
 a way to send (but not receive) messages to Slack Outgoing Webhook a way to receive messages from Slack based on keyword or phrase Slash Command
 a way to add /slash commands to Slack Slack Web API a full set of JSON API tools to deal with Slack Real Time API 24/7 live integration with a Slack team Slack Platform and Slack Button a way to build Slack applications for multiple teams
  6. 6. /Launch Platform
  7. 7. Slack App web app
 published in slack app directory has a slack button that redirects to slack slack returns a token app stores the token service with multiple bots start a bot per token
  8. 8. Code https://github.com/dblock/your-first-slack-ruby-bot-in-ruby Incoming Webhook
 a way to send (but not receive) messages to Slack Outgoing Webhook a way to receive messages from Slack based on keyword or phrase Slash Command
 a way to add /slash commands to Slack Slack Web API a full set of JSON API tools to deal with Slack Real Time API 24/7 live integration with a Slack team Slack Platform and Slack Button a way to build Slack applications for multiple teams
  9. 9. Clients https://api.slack.com/community
  10. 10. https://github.com/slackhq/node-slack-client Slack-Node-Client var client = require('../lib/clients/web/client'); client.chat.postMessage(‘#general’, ‘Hello World', data, …);
  11. 11. client = Slack::Web::Client.new(token: token)
 client.chat_postMessage(channel: '#general', text: 'Hello World’) https://github.com/dblock/slack-ruby-client Slack-Ruby-Client
  12. 12. https://github.com/slackhq/node-slack-client Slack-Node-Client var client = require(‘@slack/client').RtmClient; var rtm = new RtmClient(token, {logLevel: 'debug'}); rtm.start(); var RTM_EVENTS = require('@slack/client').RTM_EVENTS; rtm.on(RTM_EVENTS.MESSAGE, function (message) { … });
  13. 13. client = Slack::RealTime::Client.new(token: token) client.on :message do |data| case data.text when 'bot hi' then client.message channel: data.channel, text: "Hi <@#{data.user}>!" end end client.start! https://github.com/dblock/slack-ruby-client Slack-Ruby-Client
  14. 14. https://github.com/slackhq/node-slack-client https://github.com/dblock/slack-ruby-client Local Store rtm.start
 channels, users, messages, etc. events https://api.slack.com/events, user_typing, message, channel_joined
  15. 15. https://github.com/howdyai/botkit supports all slack APIs hears what is said in Slack replies to what is said in Slack supports conversations storage Botkit
  16. 16. https://github.com/dblock/slack-ruby-bot real-time and web apis only commands operators regex matchers events Slack-Ruby-Bot
  17. 17. market.playplay.io
  18. 18. api-explorer.playplay.io
  19. 19. playplay.io leaderboards challenges matches seasons GIFs 

  20. 20. shell.playplay.io
  21. 21. playplay.io stats
 266 active teams 3971 games played 996 players dev ruby grape mongodb slack-ruby-* ops from Heroku to Digital Ocean Dokku PaaS loves RAM hard to scale horizontally $$$ barely any sponsor money
  22. 22. What to build? Find what people already do at work all day long. Make a bot that helps a team collaborate around that.
 Productivity Analytics Communication Customer Support Design Developer Tools File Management Project Management …
  23. 23. @dblockdotorg

×