Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit b0c7e7b

Browse files
committed
Use released version of slack-ruby-bot-server 1.0.0.
1 parent eba25c8 commit b0c7e7b

File tree

6 files changed

+29
-4
lines changed

6 files changed

+29
-4
lines changed

Gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ else
1919
warn "Invalid ENV['DATABASE_ADAPTER']: #{ENV['DATABASE_ADAPTER']}."
2020
end
2121

22-
gem 'slack-ruby-bot-server', github: 'dblock/slack-ruby-bot-server', branch: 'extract-rtm'
23-
2422
gemspec
2523

2624
group :development, :test do

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,26 @@ setting | description
3333
----------------------|------------------------------------------------------------------
3434
|
3535

36+
#### Server Class
37+
38+
You can override the server class to handle additional events, and configure the service to use it.
39+
40+
```ruby
41+
class MyServer < SlackRubyBotServer::Server
42+
on :hello do |client, data|
43+
# connected to Slack
44+
end
45+
46+
on :channel_joined do |client, data|
47+
# the bot joined a channel in data.channel['id']
48+
end
49+
end
50+
51+
SlackRubyBotServer::RealTime.configure do |config|
52+
config.server_class = MyServer
53+
end
54+
```
55+
3656
### Copyright & License
3757

3858
Copyright [Daniel Doubrovkine](http://code.dblock.org) and Contributors, 2020

lib/slack-ruby-bot-server-rtm/lifecycle.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# frozen_string_literal: true
22

3+
SlackRubyBotServer.configure do |config|
4+
config.oauth_scope ||= ['bot']
5+
end
6+
37
SlackRubyBotServer::Config.service_class.instance.on :starting do |team, _error, options|
48
SlackRubyBotServer::Config.service_class.instance.logger.info "Starting real-time team #{team}."
59
options = { team: team }

sample_apps/sample_app_activerecord/Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ gem 'otr-activerecord', '~> 1.2.1'
88
gem 'pg'
99
gem 'rack-server-pages'
1010
gem 'rack-test'
11-
gem 'slack-ruby-bot-server', github: 'dblock/slack-ruby-bot-server', branch: 'extract-rtm'
1211
gem 'slack-ruby-bot-server-rtm', path: '../../'
1312
gem 'unicorn'
1413

sample_apps/sample_app_mongoid/Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ source 'https://rubygems.org'
44

55
gem 'mongoid'
66
gem 'newrelic-slack-ruby-bot'
7-
gem 'slack-ruby-bot-server', github: 'dblock/slack-ruby-bot-server', branch: 'extract-rtm'
87
gem 'slack-ruby-bot-server-rtm', path: '../../'
98

109
gem 'kaminari-mongoid'

spec/slack-ruby-bot-server-rtm/lifecycle_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
expect(server).to receive(:start_async)
1616
SlackRubyBotServer::Service.instance.start!(team)
1717
end
18+
context 'config' do
19+
it 'sets bot OAuth scope' do
20+
expect(SlackRubyBotServer.config.oauth_scope).to eq ['bot']
21+
end
22+
end
1823
context 'started team' do
1924
before do
2025
allow(server).to receive(:start_async)

0 commit comments

Comments
 (0)