your first slack bot service (nyc slack meetup)
TRANSCRIPT
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 APIReal Time Messaging APISlack Platform Services
ClientsFrameworks
Integrations
Incoming Webhooka way to send (but not receive) messages to Slack Outgoing Webhooka way to receive messages from Slack based on keyword or phrase Slash Commanda way to add /slash commands to Slack Slack Web APIa full set of JSON API tools to deal with Slack Real Time API24/7 live integration with a Slack team Slack Platform and Slack Buttona way to build Slack applications for multiple teams
/Launch Platform
Slack App
web apppublished in slack app directory has a slack button that redirects to slack slack returns a token app stores the token
service with multiple botsstart a bot per token
Codehttps://github.com/dblock/your-first-slack-ruby-bot-in-ruby
Incoming Webhooka way to send (but not receive) messages to Slack Outgoing Webhooka way to receive messages from Slack based on keyword or phrase Slash Commanda way to add /slash commands to Slack Slack Web APIa full set of JSON API tools to deal with Slack Real Time API24/7 live integration with a Slack team Slack Platform and Slack Buttona way to build Slack applications for multiple teams
Clientshttps://api.slack.com/community
https://github.com/slackhq/node-slack-client Slack-Node-Client
var client = require('../lib/clients/web/client'); client.chat.postMessage(‘#general’, ‘Hello World', data, …);
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
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) { … });
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
https://github.com/slackhq/node-slack-client https://github.com/dblock/slack-ruby-client
Local Store
rtm.startchannels, users, messages, etc. eventshttps://api.slack.com/events, user_typing, message, channel_joined
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
https://github.com/dblock/slack-ruby-bot
real-time and web apis only commands operators regex matchers events
Slack-Ruby-Bot
market.playplay.io
api-explorer.playplay.io
playplay.ioleaderboards challenges matches seasons GIFs
shell.playplay.io
playplay.iostats 266 active teams 3971 games played 996 players devruby grape mongodb slack-ruby-* opsfrom Heroku to Digital Ocean Dokku PaaS loves RAM hard to scale horizontally $$$barely any sponsor money
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 CommunicationCustomer Support Design Developer Tools File Management Project Management …
@dblockdotorg