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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7a15a38ce2fc91e13fa83dd21d3a9edd51ccceb
4
- data.tar.gz: 62768ecf0d8883cd1ec56cc1ea1caff5f0cfd700
3
+ metadata.gz: bcb58b9a3ba12dbb617c7f3e04066646578eb8a1
4
+ data.tar.gz: 6da41c043538fa3ce173548102c567f14dff1caf
5
5
  SHA512:
6
- metadata.gz: 44ea15a214938e23448bf4e4c2956480429ca78f1b4ba8b61df23e95566f54d60d7278840f6e5c3e817856dc9046ba8c501790fadd6c923ec0e469d566850bea
7
- data.tar.gz: 9508a326e0ccd2ec33c74fd20f26936ef08889a1e80ac033703019e191773d54f8da4f2b0e577dce1e3e68b68b2c70f5f7d8e39c4cf71119ae31c4da6c1bbac9
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
- realtime.send_message(
31
- type: 'message',
32
- channel: channel,
33
- text: message[:code] ? "```\n#{message[:body]}\n```" : resolve_send_mention(message[:body]),
34
- mrkdwn: true
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
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module SlackRTM
3
- VERSION = '2.5.1'
3
+ VERSION = '2.6.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: 2.5.1
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-08-29 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler