slack-smart-bot 0.6.13 → 0.6.14

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -0
  3. data/lib/slack-smart-bot.rb +1 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5daa382f51b4857bd58defaface6e88f36172c7597059015aab5dc24740fc27
4
- data.tar.gz: 72498adc977f7d14f155e8c4b6f5fa37a350404de69b63bd9fd8b6f3745e9806
3
+ metadata.gz: 10f38724dc8c8daf0feca388ceeae3bbb912c273b28dc785cefe939cba856183
4
+ data.tar.gz: a2b192d16361bf91adeb41fde8c9dcb17a70b07c1eef86cbfb102548ff6d0c6f
5
5
  SHA512:
6
- metadata.gz: 5dea8a83b702de880d447ac953e5e636835c06df3490dc4a8d7dfe35fe0d97120f55c6771401b3b4cd5af7b221ae42d882b7d9ed22f780580daeb2a1449b6980
7
- data.tar.gz: f3711fdbe88657e5a6568cdb8848a7c5eee9434eec25c0ac1d5c6a73cc903aa2f44d739b08921064a5ccd51c4f6e06f67a334807ae3a771a6d3f17fceb51c3de
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.
@@ -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
- p command
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.13
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-02 00:00:00.000000000 Z
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