ruboty-slack_rtm 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6759957c3bf95c5967f5b63e915bf0977f178162
4
- data.tar.gz: bd8c2d47ed3fa3ca0cd0a4607a42deb6e9fda03d
3
+ metadata.gz: 23919e4dac311365e1d4ff201b2e9a909145de27
4
+ data.tar.gz: 77b8f3264cac7608b8bf12c0e093a86f29a61683
5
5
  SHA512:
6
- metadata.gz: 6043a3c9e140a419d7888ee2f8c503094b9550ab2140efd72de556714b2e0cca21c85c4113369e3f3f8f1a918628e2d39ae2b8c9a1f69e6b71ffe4fb427df873
7
- data.tar.gz: f938480d9e3295375d7e6d45d39164ea0fc88d6a05a9c5fe13ac089282033ae5efea9148cb91369df61bf2b84709075c357886d985d47c0f892dd34aaf85e2de
6
+ metadata.gz: 36869ec11a7b0e7dfb3af3b4c7f36ff541fa6fb6a3d8cf5ef9438b5f9d5b5176152dc67e7ef4dcc4c5eae2ec057967caec6f50df04c7e3719480241f038248d4
7
+ data.tar.gz: 179cdde1bb7d9d5c76cfac05621eba14618d13061b15a70ef4c383b1361f192b368b875d0921d13b25d350946cf532b59e239731e9c4c70bc0e580f2f80e2046
data/README.md CHANGED
@@ -14,6 +14,7 @@ gem 'ruboty-slack_rtm'
14
14
 
15
15
  - `SLACK_TOKEN`: Account's token. get one on https://api.slack.com/web#basics
16
16
  - `SLACK_EXPOSE_CHANNEL_NAME`: if this set to 1, `message.to` will be channel name instead of id (optional)
17
+ - `SLACK_IGNORE_GENERAL`: if this set to 1, bot ignores all messages on #general channel (optional)
17
18
 
18
19
  This adapter doesn't require a real user account. Using with bot integration's API token is recommended.
19
20
  See: https://api.slack.com/bot-users
@@ -9,6 +9,7 @@ module Ruboty
9
9
  class SlackRTM < Base
10
10
  env :SLACK_TOKEN, "Account's token. get one on https://api.slack.com/web#basics"
11
11
  env :SLACK_EXPOSE_CHANNEL_NAME, "if this set to 1, message.to will be channel name instead of id", optional: true
12
+ env :SLACK_IGNORE_GENERAL, "if this set to 1, bot ignores all messages on #general channel", optional: true
12
13
 
13
14
  def run
14
15
  init
@@ -94,7 +95,10 @@ module Ruboty
94
95
  user = user_info(data['user']) || {}
95
96
 
96
97
  channel = channel_info(data['channel'])
98
+
97
99
  if channel
100
+ return if channel['name'] == 'general' && ENV['SLACK_IGNORE_GENERAL'] == '1'
101
+
98
102
  channel_to = expose_channel_name? ? "##{channel['name']}" : channel['id']
99
103
  else # direct message
100
104
  channel_to = data['channel']
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module SlackRTM
3
- VERSION = '1.3.1'
3
+ VERSION = '1.4.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-slack_rtm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Kusano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-04 00:00:00.000000000 Z
11
+ date: 2015-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler