slack-ruby-bot-server-rtm 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -2
- data/lib/slack-ruby-bot-server-rtm/server.rb +7 -7
- data/lib/slack-ruby-bot-server-rtm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5824cb54023d4ee24f318fe9b455cd4ccc3b450ecaec0ccc893223517e823d87
|
4
|
+
data.tar.gz: aca8db91d16aeb611f25bb0784deab2072fbcb777c32b155c6fa8a9bdf8afb31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ab696238cbe2b831efc55fc705d3b4d2e06b5e4594fbd5a2694b1bfb4faf8a3415b7292ffdf3bd223ef880f465e7ad6d29137920d6190976a214ec727ea284c
|
7
|
+
data.tar.gz: a84c2a77ee1007efeee7114145d539ba8183b43ca38b4650ca5c0a6f422826a973c4b75e47ecb47347e36b46bb014cf1fb4c70948ec6125b690145487db1cb28
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
### Changelog
|
2
2
|
|
3
|
+
#### 0.1.1 (2020/11/15)
|
4
|
+
|
5
|
+
* Fix: error `private method 'run_callbacks' called for #<SlackRubyBotServer::Service>` - [@dblock](https://github.com/dblock).
|
6
|
+
|
3
7
|
#### 0.1.0 (2020/11/15)
|
4
8
|
|
5
9
|
* Initial public release - [@dblock](https://github.com/dblock).
|
data/README.md
CHANGED
@@ -6,9 +6,9 @@ Slack Ruby Bot Server RealTime (RTM) Extension
|
|
6
6
|
|
7
7
|
An extension to [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server) that makes it easy to implement Slack RTM bots.
|
8
8
|
|
9
|
-
###
|
9
|
+
### Samples
|
10
10
|
|
11
|
-
|
11
|
+
You can use one of the [sample applications](sample_apps) that use MongoDB or ActiveRecord to bootstrap your project and start adding slack command handlers on top of this code.
|
12
12
|
|
13
13
|
### Usage
|
14
14
|
|
@@ -21,14 +21,14 @@ module SlackRubyBotServer
|
|
21
21
|
team.server = server
|
22
22
|
server.start_async
|
23
23
|
rescue StandardError => e
|
24
|
-
SlackRubyBotServer::Config.service_class.instance.run_callbacks :error, team, e
|
24
|
+
SlackRubyBotServer::Config.service_class.instance.send(:run_callbacks, :error, team, e)
|
25
25
|
case e.message
|
26
26
|
when 'account_inactive', 'invalid_auth' then
|
27
|
-
SlackRubyBotServer::Config.logger.error "#{team.name}: #{e.message}, team will be deactivated."
|
28
|
-
SlackRubyBotServer::
|
29
|
-
|
27
|
+
SlackRubyBotServer::Config.service_class.instance.logger.error "#{team.name}: #{e.message}, team will be deactivated."
|
28
|
+
SlackRubyBotServer::Config.service_class.instance.deactivate! team
|
29
|
+
else
|
30
30
|
wait = e.retry_after if e.is_a?(Slack::Web::Api::Errors::TooManyRequestsError)
|
31
|
-
SlackRubyBotServer::Config.logger.error "#{team.name}: #{e.message}, restarting in #{wait} second(s)."
|
31
|
+
SlackRubyBotServer::Config.service_class.instance.logger.error "#{team.name}: #{e.message}, restarting in #{wait} second(s)."
|
32
32
|
sleep(wait)
|
33
33
|
start_server! team, server, [wait * 2, 60].min
|
34
34
|
end
|
@@ -37,8 +37,8 @@ module SlackRubyBotServer
|
|
37
37
|
def restart!(_wait = 1)
|
38
38
|
# when an integration is disabled, a live socket is closed, which causes the default behavior of the client to restart
|
39
39
|
# it would keep retrying without checking for account_inactive or such, we want to restart via service which will disable an inactive team
|
40
|
-
logger.info "#{team.name}: socket closed, restarting ..."
|
41
|
-
SlackRubyBotServer::
|
40
|
+
SlackRubyBotServer::Config.service_class.instance.logger.info "#{team.name}: socket closed, restarting ..."
|
41
|
+
SlackRubyBotServer::Config.service_class.instance.restart! team
|
42
42
|
open!
|
43
43
|
end
|
44
44
|
|