slack-smart-bot 0.6.13 → 0.6.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -0
- data/lib/slack-smart-bot.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10f38724dc8c8daf0feca388ceeae3bbb912c273b28dc785cefe939cba856183
|
4
|
+
data.tar.gz: a2b192d16361bf91adeb41fde8c9dcb17a70b07c1eef86cbfb102548ff6d0c6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ba6baa99c3261f48e17c59d35dbf9a7a6ff78402dca350f234586e48ea4d33e2b43826085f03ba5e369e5a5a4a5de180a257a49d93dd4edf8685663838252cd
|
7
|
+
data.tar.gz: c9e247aeab84595d99cbd64d917517c7fc3dfd59c0f57a739195611d18d3878b2dd3ae66f477f99c94ca89ecb5c23bcf00e41e87d97b33a9e267830a486b9218
|
data/README.md
CHANGED
@@ -29,6 +29,8 @@ settings = {
|
|
29
29
|
token: 'xxxxxxxxxxxxxxxxxx' # the API Slack token
|
30
30
|
}
|
31
31
|
|
32
|
+
pid = Process.pid
|
33
|
+
|
32
34
|
restarts = 0
|
33
35
|
loop {
|
34
36
|
SlackSmartBot.new(settings).listen
|
@@ -36,10 +38,25 @@ loop {
|
|
36
38
|
puts "More than 300 restarts. Quitting!"
|
37
39
|
break
|
38
40
|
end
|
41
|
+
|
42
|
+
if ARGV.size == 0 #on master channel
|
43
|
+
#kill the running sub bots
|
44
|
+
children = `pgrep -P #{pid}`.split("\n")
|
45
|
+
children.each do |pc|
|
46
|
+
`kill #{pc}`
|
47
|
+
end
|
48
|
+
sleep 1
|
49
|
+
children = `pgrep -P #{pid}`.split("\n")
|
50
|
+
children.each do |pc|
|
51
|
+
puts "Pay attention!!! Process pid: #{pc} still Running"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
39
55
|
restarts+=1
|
40
56
|
puts "Restarting: #{restarts}"
|
41
57
|
sleep 20
|
42
58
|
}
|
59
|
+
|
43
60
|
```
|
44
61
|
|
45
62
|
The MASTER_CHANNEL will be the channel where you will be able to create other bots and will have special treatment.
|
data/lib/slack-smart-bot.rb
CHANGED
@@ -210,10 +210,9 @@ class SlackSmartBot
|
|
210
210
|
((command[0] == "`" and command[-1] == "`") or (command[0] == "*" and command[-1] == "*") or (command[0] == "_" and command[-1] == "_"))
|
211
211
|
command = command[1..-2]
|
212
212
|
end
|
213
|
-
p command
|
214
213
|
|
215
214
|
command = "!" + command unless command[0] == "!"
|
216
|
-
|
215
|
+
|
217
216
|
if @channels_id[CHANNEL] == channel_rules #to be treated only on the bot of the requested channel
|
218
217
|
dest = data.channel
|
219
218
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-smart-bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slack-ruby-client
|