ruboty-slack_rtm 2.5.1 → 2.6.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 +18 -6
- 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: bcb58b9a3ba12dbb617c7f3e04066646578eb8a1
|
4
|
+
data.tar.gz: 6da41c043538fa3ce173548102c567f14dff1caf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b90254b2cf54b27b690ce1d81fcaba8a268570ef0768076e1d3bf1100122b67aeeb5f73276045332ef07e574de5005630fc88681798118e9dabefd55013a9e8
|
7
|
+
data.tar.gz: 87f595eb436f0379740ff55e1dbca9f9ee642176e36176aa90754fda1d7cf69cad9fd91e66bd16285ae3564f902b94f4cf01f6e492c67c79ebf8ec3f4d4085f7
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'cgi'
|
2
2
|
require 'time'
|
3
|
+
require 'json'
|
3
4
|
require 'slack'
|
4
5
|
require 'ruboty/adapters/base'
|
5
6
|
|
@@ -27,12 +28,23 @@ module Ruboty
|
|
27
28
|
|
28
29
|
return unless channel
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
if message[:attachments] && !message[:attachments].empty?
|
32
|
+
client.chat_postMessage(
|
33
|
+
channel: channel,
|
34
|
+
text: message[:code] ? "```\n#{message[:body]}\n```" : message[:body],
|
35
|
+
parse: 'full',
|
36
|
+
unfurl_links: true,
|
37
|
+
as_user: true,
|
38
|
+
attachments: message[:attachments].to_json
|
39
|
+
)
|
40
|
+
else
|
41
|
+
realtime.send_message(
|
42
|
+
type: 'message',
|
43
|
+
channel: channel,
|
44
|
+
text: message[:code] ? "```\n#{message[:body]}\n```" : resolve_send_mention(message[:body]),
|
45
|
+
mrkdwn: true
|
46
|
+
)
|
47
|
+
end
|
36
48
|
end
|
37
49
|
|
38
50
|
private
|
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: 2.
|
4
|
+
version: 2.6.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: 2016-
|
11
|
+
date: 2016-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|