ruboty-slack_rtm 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruboty/adapters/slack_rtm.rb +19 -1
- data/lib/ruboty/slack_rtm/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f95736f27208e55dcea4fad8b2cd2335ca3bfcd3
|
4
|
+
data.tar.gz: 141a8135f8c1765193d09834f4a452ce034f0124
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f9413b2f75f3de4854295805c4ef7ecb878b9f2eb5fe55f2595265ef0e54e7ed46c26f8c290d22973b107c9cdc3a9e25e75fb25ad304d7f7a990739fd0ad4c9
|
7
|
+
data.tar.gz: 484e7ce9b6ec14d2222d2278f4599d964a78c3e9adfe4b5db5fd71ec9ea7e65df632b41b0b9926b60cdf3388e6d551495f7f599b0391e5038caaa01d520fa524
|
@@ -15,9 +15,16 @@ module Ruboty
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def say(message)
|
18
|
+
channel = message[:to]
|
19
|
+
if channel[0] == '#'
|
20
|
+
channel = resolve_channel_id(channel[1..-1])
|
21
|
+
end
|
22
|
+
|
23
|
+
return unless channel
|
24
|
+
|
18
25
|
realtime.send(
|
19
26
|
type: 'message',
|
20
|
-
channel:
|
27
|
+
channel: channel,
|
21
28
|
text: message[:code] ? "```\n#{message[:body]}\n```" : resolve_send_mention(message[:body]),
|
22
29
|
mrkdwn: true
|
23
30
|
)
|
@@ -220,6 +227,17 @@ module Ruboty
|
|
220
227
|
resp['channel']
|
221
228
|
end
|
222
229
|
end
|
230
|
+
|
231
|
+
def resolve_channel_id(name)
|
232
|
+
ret_id = nil
|
233
|
+
@channel_info_cahces.each_pair do |id, channel|
|
234
|
+
if channel['name'] == name
|
235
|
+
ret_id = id
|
236
|
+
break
|
237
|
+
end
|
238
|
+
end
|
239
|
+
return ret_id
|
240
|
+
end
|
223
241
|
end
|
224
242
|
end
|
225
243
|
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.0
|
4
|
+
version: 1.1.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-
|
11
|
+
date: 2015-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.4.
|
134
|
+
rubygems_version: 2.4.6
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Slack real time messaging adapter for Ruboty
|