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 +4 -4
- data/README.md +1 -0
- data/lib/ruboty/adapters/slack_rtm.rb +4 -0
- data/lib/ruboty/slack_rtm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23919e4dac311365e1d4ff201b2e9a909145de27
|
4
|
+
data.tar.gz: 77b8f3264cac7608b8bf12c0e093a86f29a61683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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']
|
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.
|
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-
|
11
|
+
date: 2015-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|