your first slack bot service (nyc slack meetup)

31
Your First Slack Bot Service @dblockdotorg http://www.meetup.com/New-York-Slack-Meetup/ March 10, 2016

Upload: daniel-doubrovkine

Post on 15-Apr-2017

778 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Your First Slack Bot Service (NYC Slack Meetup)

Your First Slack Bot Service@dblockdotorg

http://www.meetup.com/New-York-Slack-Meetup/ March 10, 2016

Page 2: Your First Slack Bot Service (NYC Slack Meetup)
Page 3: Your First Slack Bot Service (NYC Slack Meetup)
Page 4: Your First Slack Bot Service (NYC Slack Meetup)

dB.

there’s a bottleneck in the db query the db is down

did you set the correct db credentials? mongo db

Page 5: Your First Slack Bot Service (NYC Slack Meetup)
Page 6: Your First Slack Bot Service (NYC Slack Meetup)
Page 7: Your First Slack Bot Service (NYC Slack Meetup)

Q?deferred?

reject?accept?

Page 8: Your First Slack Bot Service (NYC Slack Meetup)

Integration Overview

Web APIReal Time Messaging APISlack Platform Services

ClientsFrameworks

Page 9: Your First Slack Bot Service (NYC Slack Meetup)

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

Page 10: Your First Slack Bot Service (NYC Slack Meetup)

/Launch Platform

Page 11: Your First Slack Bot Service (NYC Slack Meetup)

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

Page 12: Your First Slack Bot Service (NYC Slack Meetup)

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

Page 13: Your First Slack Bot Service (NYC Slack Meetup)

Clientshttps://api.slack.com/community

Page 14: Your First Slack Bot Service (NYC Slack Meetup)

https://github.com/slackhq/node-slack-client Slack-Node-Client

var client = require('../lib/clients/web/client'); client.chat.postMessage(‘#general’, ‘Hello World', data, …);

Page 15: Your First Slack Bot Service (NYC Slack Meetup)

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

Page 16: Your First Slack Bot Service (NYC Slack Meetup)

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) { … });

Page 17: Your First Slack Bot Service (NYC Slack Meetup)

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

Page 18: Your First Slack Bot Service (NYC Slack Meetup)

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

Page 19: Your First Slack Bot Service (NYC Slack Meetup)

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

Page 20: Your First Slack Bot Service (NYC Slack Meetup)

https://github.com/dblock/slack-ruby-bot

real-time and web apis only commands operators regex matchers events

Slack-Ruby-Bot

Page 21: Your First Slack Bot Service (NYC Slack Meetup)

market.playplay.io

Page 22: Your First Slack Bot Service (NYC Slack Meetup)
Page 23: Your First Slack Bot Service (NYC Slack Meetup)

api-explorer.playplay.io

Page 24: Your First Slack Bot Service (NYC Slack Meetup)
Page 25: Your First Slack Bot Service (NYC Slack Meetup)

playplay.ioleaderboards challenges matches seasons GIFs

Page 26: Your First Slack Bot Service (NYC Slack Meetup)
Page 27: Your First Slack Bot Service (NYC Slack Meetup)

shell.playplay.io

Page 28: Your First Slack Bot Service (NYC Slack Meetup)
Page 29: Your First Slack Bot Service (NYC Slack Meetup)

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

Page 30: Your First Slack Bot Service (NYC Slack Meetup)

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 …

Page 31: Your First Slack Bot Service (NYC Slack Meetup)

@dblockdotorg