SlideShare a Scribd company logo
Building SlackBuilding Slack
Apps withApps with
RubyRuby
Integrations OverviewIntegrations Overview
Slash Commands
Custom Integrations
Bot Users
Incoming Webhooks
Incoming webhooksIncoming webhooks
A way to send messages to Slack
https://slack.com/apps/A0F7XDUAZ-incoming-webhooks
Incoming webhooksIncoming webhooks
require 'slack/incoming/webhooks'
slack = Slack::Incoming::Webhooks.new(
'WEBHOOK_URL'
)
slack.post 'Useful information'
https://github.com/shoyan/slack-incoming-webhooks
ExampleExample
Slash commandsSlash commands
A way to add /slash commands
Creating a new Slack App
Command request authorization
Command validation and response
Sending messages through Slack Web API
Creating a Slack AppCreating a Slack App
https://api.slack.com/apps
Response PermissionResponse Permission
Adding a commandAdding a command
Local HTTPS-ProxyLocal HTTPS-Proxy
./ngrok http 9292
Response SampleResponse Sample
require 'sinatra'
post '/' do
'OK'
end
Building Slack Apps with Ruby – Kirill Shevchenko
Legacy custom integrationsLegacy custom integrations
Custom integrationsCustom integrations
https://api.slack.com/custom-integrations/legacy-tokens
Bot usersBot users
ToolsTools
https://github.com/slack-ruby
slack-ruby-botslack-ruby-bot
Provides DSL for building text commands.
slack-ruby-clientslack-ruby-client
A Ruby and command-line client for the Slack Web and
Real Time Messaging APIs.
slack-ruby-botslack-ruby-bot
require 'slack-ruby-bot'
class PongBot < SlackRubyBot::Bot
command 'ping' do |client, data, match|
client.say(text: 'pong', channel: data.channel)
end
end
PongBot.run
A Minimal Bot
SLACK_API_TOKEN=... bundle exec ruby pongbot.rb
AuthenticationAuthentication
{
"access_token": "xoxp-XXXXXXXX-XXXXXXXX-XXXXX",
"scope": "commands,bot",
"team_name": "Team Installing Your Bot",
"team_id": "XXXXXXXXXX",
"bot":{
"bot_user_id":"UTTTTTTTTTTR",
"bot_access_token":"xoxb-XXXXXXXXXXXX-TTTTTTTTTTTTTT"
}
}
ResponseResponse
Slack Web APISlack Web API
The Web API is a collection of , all with
URLs in the form:
HTTP RPC-style methods
https://slack.com/api/METHOD_FAMILY.method 
slack-ruby-clientslack-ruby-client
client = Slack::Web::Client.new(
token: 'SLACK_BOT_TOKEN'
)
client.chat_postMessage(
channel: '#general', text: 'Hello World'
)
https://api.slack.com/methods/chat.postMessage
Web API rate limitWeb API rate limit
https://api.slack.com/methods/chat.update
Interactive messagesInteractive messages
https://api.slack.com/interactive-messages
Message FormattingMessage Formatting
https://api.slack.com/docs/messages/builder
Walkie BotWalkie Bot
Prototyping Tool for Slack Bots
https://github.com/FoundersAS/walkiebot
Building Slack Apps with Ruby – Kirill Shevchenko
Slack RTMSlack RTM
The Real Time Messaging API is a WebSocket-based API that
allows you to receive  from Slack in real time.events
rtm.connectrtm.connect
Workspace
https://api.slack.com/methods/rtm.connect
wss://slack-msgs.com/websocket/uid
client = Slack::RealTime::Client.new(
token: 'SLACK_BOT_TOKEN'
)
client.on :message do |data|
client.message(
channel: data.channel,
text: "Hi <@#{data.user}>!"
)
end
client.start!
Ruby Websocket ClientsRuby Websocket Clients
Faye::Websocket
websocket-client-simple
Multiple connectionsMultiple connections
Workspace 1
Workspace 2
Workspace N
wss://slack-msgs.com/websocket/uid
wss://slack-msgs.com/websocket/uid
wss://slack-msgs.com/websocket/uid
Concurrent ProcessingConcurrent Processing
eventmachine
celluloid
concurrent-ruby
slack-ruby-clientslack-ruby-client
Slack::RealTime.configure do |config|
config.concurrency = Slack::RealTime::Concurrency::Celluloid
# config.concurrency = Slack::RealTime::Concurrency::Eventmachine
end
Building Slack Apps with Ruby – Kirill Shevchenko
AlternativesAlternatives
https://github.com/slackapi/node-slack-sdk
https://github.com/BlakeWilliams/Elixir-Slack
Building Slack Apps with Ruby – Kirill Shevchenko
API UpdatesAPI Updates
https://slack.com/apps/A0F81R7U7-rss
CommunityCommunity
https://community.botkit.ai
Thanks!Thanks!
kirillshevchkirillshevch
@kirill_shevch@kirill_shevch
@kirill_shevch@kirill_shevch

More Related Content

PDF
"Building a Production-Grade Serverless Deployment" - Eoin Shanaghy, CTO, fo...
PPTX
"Don’t Run with Scissors: Serverless Security Survival Guide" | Hillel Solow,...
PDF
php[world] 2015 Training - Laravel from the Ground Up
PPTX
Best Practices for creating WP REST API by Galkin Nikita
PDF
KKBOX WWDC17 Security - Antony
PPT
Testing Any Site With Cucumber and Selenium
PDF
Automation of web attacks from advisories to create real world exploits
PDF
Introducing Firebase by Google
"Building a Production-Grade Serverless Deployment" - Eoin Shanaghy, CTO, fo...
"Don’t Run with Scissors: Serverless Security Survival Guide" | Hillel Solow,...
php[world] 2015 Training - Laravel from the Ground Up
Best Practices for creating WP REST API by Galkin Nikita
KKBOX WWDC17 Security - Antony
Testing Any Site With Cucumber and Selenium
Automation of web attacks from advisories to create real world exploits
Introducing Firebase by Google

What's hot (20)

PDF
Spring Boot & Actuators
PDF
WP-CLI: Unleash the power
PDF
BDD in Java using Cucumber
PDF
Advanced Spring Boot with Consul
PDF
Unleashing Docker with Pipelines in Bitbucket Cloud
PDF
Zero to #Serverless in 60 seconds, anywhere
PPTX
Spring Boot and REST API
PDF
Panoramic view of web APIs
PDF
Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...
PDF
Performance Testing using Real Browsers with JMeter & Webdriver
PDF
How to Build a Better JIRA Add-on
PPTX
ASP.NET Core 2.1: The Future of Web Apps
PPTX
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
PDF
KKBOX WWDC17 Performance and Testing - Hokila
PDF
Real-time Automation Result in Slack Channel
PDF
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
PDF
Build your own secure and real-time dashboard for mobile and web
PPTX
PDF
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
PPTX
London Community Summit 2016 - Fresh New Chef Stuff
Spring Boot & Actuators
WP-CLI: Unleash the power
BDD in Java using Cucumber
Advanced Spring Boot with Consul
Unleashing Docker with Pipelines in Bitbucket Cloud
Zero to #Serverless in 60 seconds, anywhere
Spring Boot and REST API
Panoramic view of web APIs
Make Your Selenium Suite Faster and Reliable: Test Setup with REST APIs - SQA...
Performance Testing using Real Browsers with JMeter & Webdriver
How to Build a Better JIRA Add-on
ASP.NET Core 2.1: The Future of Web Apps
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
KKBOX WWDC17 Performance and Testing - Hokila
Real-time Automation Result in Slack Channel
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Build your own secure and real-time dashboard for mobile and web
OpenFaaS KubeCon Zero to Serverless in 60 seconds anywhere
London Community Summit 2016 - Fresh New Chef Stuff
Ad

Similar to Building Slack Apps with Ruby – Kirill Shevchenko (20)

PDF
Introduction to Slack App Development
PPTX
Use Slack in software development processes
PDF
Building a Slack Bot Workshop @ Nearsoft OctoberTalks 2017
PDF
Build apps for slack
PPTX
Slack apps
PPTX
Automatic Test Results Publishing using Slack
PDF
How to Develop Slack Bot Using Golang.pdf
PDF
Introductions of Messaging bot 做聊天機器人
PPTX
Building a slack bot
PDF
Chat Bots and how to build a Slack bot
PPTX
Slack Integration Noida Meetup.pptx
PDF
Hello PyBot
PDF
Building Enterprise Chat Bots
PDF
Building a slackbot
PDF
Slack Apps: Best practices & Use Cases!
PDF
Identifying and solving enterprise problems
PDF
[2019 south bay meetup] Building more contextual message with Block Kit
PPTX
The Journey to conversational interfaces
PPTX
ChatGPT and Slack Integration with MuleSoft
KEY
Using and scaling Rack and Rack-based middleware
Introduction to Slack App Development
Use Slack in software development processes
Building a Slack Bot Workshop @ Nearsoft OctoberTalks 2017
Build apps for slack
Slack apps
Automatic Test Results Publishing using Slack
How to Develop Slack Bot Using Golang.pdf
Introductions of Messaging bot 做聊天機器人
Building a slack bot
Chat Bots and how to build a Slack bot
Slack Integration Noida Meetup.pptx
Hello PyBot
Building Enterprise Chat Bots
Building a slackbot
Slack Apps: Best practices & Use Cases!
Identifying and solving enterprise problems
[2019 south bay meetup] Building more contextual message with Block Kit
The Journey to conversational interfaces
ChatGPT and Slack Integration with MuleSoft
Using and scaling Rack and Rack-based middleware
Ad

More from Ruby Meditation (20)

PDF
Is this Legacy or Revenant Code? - Sergey Sergyenko | Ruby Meditation 30
PDF
Life with GraphQL API: good practices and unresolved issues - Roman Dubrovsky...
PDF
Where is your license, dude? - Viacheslav Miroshnychenko | Ruby Meditation 29
PDF
Dry-validation update. Dry-validation vs Dry-schema 1.0 - Aleksandra Stolyar ...
PDF
How to cook Rabbit on Production - Bohdan Parshentsev | Ruby Meditation 28
PDF
How to cook Rabbit on Production - Serhiy Nazarov | Ruby Meditation 28
PDF
Reinventing the wheel - why do it and how to feel good about it - Julik Tarkh...
PDF
Performance Optimization 101 for Ruby developers - Nihad Abbasov (ENG) | Ruby...
PDF
Use cases for Serverless Technologies - Ruslan Tolstov (RUS) | Ruby Meditatio...
PDF
The Trailblazer Ride from the If Jungle into a Civilised Railway Station - Or...
PDF
What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27
PDF
New features in Rails 6 - Nihad Abbasov (RUS) | Ruby Meditation 26
PDF
Security Scanning Overview - Tetiana Chupryna (RUS) | Ruby Meditation 26
PDF
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
PDF
Best practices. Exploring - Ike Kurghinyan (RUS) | Ruby Meditation 26
PDF
Road to A/B testing - Alexey Vasiliev (ENG) | Ruby Meditation 25
PDF
Concurrency in production. Real life example - Dmytro Herasymuk | Ruby Medita...
PDF
Data encryption for Ruby web applications - Dmytro Shapovalov (RUS) | Ruby Me...
PDF
Rails App performance at the limit - Bogdan Gusiev
PDF
GDPR. Next Y2K in 2018? - Anton Tkachov | Ruby Meditation #23
Is this Legacy or Revenant Code? - Sergey Sergyenko | Ruby Meditation 30
Life with GraphQL API: good practices and unresolved issues - Roman Dubrovsky...
Where is your license, dude? - Viacheslav Miroshnychenko | Ruby Meditation 29
Dry-validation update. Dry-validation vs Dry-schema 1.0 - Aleksandra Stolyar ...
How to cook Rabbit on Production - Bohdan Parshentsev | Ruby Meditation 28
How to cook Rabbit on Production - Serhiy Nazarov | Ruby Meditation 28
Reinventing the wheel - why do it and how to feel good about it - Julik Tarkh...
Performance Optimization 101 for Ruby developers - Nihad Abbasov (ENG) | Ruby...
Use cases for Serverless Technologies - Ruslan Tolstov (RUS) | Ruby Meditatio...
The Trailblazer Ride from the If Jungle into a Civilised Railway Station - Or...
What/How to do with GraphQL? - Valentyn Ostakh (ENG) | Ruby Meditation 27
New features in Rails 6 - Nihad Abbasov (RUS) | Ruby Meditation 26
Security Scanning Overview - Tetiana Chupryna (RUS) | Ruby Meditation 26
Teach your application eloquence. Logs, metrics, traces - Dmytro Shapovalov (...
Best practices. Exploring - Ike Kurghinyan (RUS) | Ruby Meditation 26
Road to A/B testing - Alexey Vasiliev (ENG) | Ruby Meditation 25
Concurrency in production. Real life example - Dmytro Herasymuk | Ruby Medita...
Data encryption for Ruby web applications - Dmytro Shapovalov (RUS) | Ruby Me...
Rails App performance at the limit - Bogdan Gusiev
GDPR. Next Y2K in 2018? - Anton Tkachov | Ruby Meditation #23

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Tartificialntelligence_presentation.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPT
Teaching material agriculture food technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
A Presentation on Artificial Intelligence
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
Programs and apps: productivity, graphics, security and other tools
Agricultural_Statistics_at_a_Glance_2022_0.pdf
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
Tartificialntelligence_presentation.pptx
20250228 LYD VKU AI Blended-Learning.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
A Presentation on Artificial Intelligence
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
Assigned Numbers - 2025 - Bluetooth® Document

Building Slack Apps with Ruby – Kirill Shevchenko