ruboty-slack_rtm 3.2.2 → 3.2.3
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 -14
- data/lib/ruboty/slack_rtm/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a735292c902d7fc4aff589e5729f9b467a948b77bcc09f47e7348c8d60768cc5
|
4
|
+
data.tar.gz: d318bdcae1a2c3fa09842dc606b8368ac16d2de46225eab88a1ff89b68d89bdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53109fa2c2fec6438f59f21f3a4a8af93e715cd0ba6bf665c0e46187adc31fd9e2c13cb080262fe6553d570b7fc8a7df2b8990f3da7c17e08f956950f0da0c5b
|
7
|
+
data.tar.gz: 7bd7dc7ed0a4fb744a571e8179b1c541d9451b587aa293a26ca8be3a2fcf8c23cfbb964cd29e973bcadacc16563dc82afa41e996a339710eac963a5c47a77488
|
@@ -29,35 +29,39 @@ module Ruboty
|
|
29
29
|
|
30
30
|
return unless channel
|
31
31
|
|
32
|
+
args = {
|
33
|
+
as_user: true
|
34
|
+
}
|
35
|
+
if message[:thread_ts] || (message[:original] && message[:original][:thread_ts])
|
36
|
+
args.merge!(thread_ts: message[:thread_ts] || message[:original][:thread_ts])
|
37
|
+
end
|
38
|
+
|
32
39
|
if message[:attachments] && !message[:attachments].empty?
|
33
|
-
|
40
|
+
args.merge!(
|
34
41
|
channel: channel,
|
35
|
-
text: message[:code] ?
|
42
|
+
text: message[:code] ? "```\n#{message[:body]}\n```" : message[:body],
|
36
43
|
parse: message[:parse] || 'full',
|
37
44
|
unfurl_links: true,
|
38
|
-
|
39
|
-
attachments: message[:attachments].to_json,
|
40
|
-
thread_ts: message[:thread_ts] || message[:original][:thread_ts]
|
45
|
+
attachments: message[:attachments].to_json
|
41
46
|
)
|
47
|
+
client.chat_postMessage(args)
|
42
48
|
elsif message[:file]
|
43
49
|
path = message[:file][:path]
|
44
|
-
|
50
|
+
args.merge!(
|
45
51
|
channels: channel,
|
46
|
-
as_user: true,
|
47
52
|
file: Faraday::UploadIO.new(path, message[:file][:content_type]),
|
48
53
|
title: message[:file][:title] || path,
|
49
54
|
filename: File.basename(path),
|
50
|
-
initial_comment: message[:body] || ''
|
51
|
-
thread_ts: message[:thread_ts] || message[:original][:thread_ts]
|
55
|
+
initial_comment: message[:body] || ''
|
52
56
|
)
|
57
|
+
client.files_upload(args)
|
53
58
|
else
|
54
|
-
|
59
|
+
args.merge!(
|
55
60
|
channel: channel,
|
56
|
-
text: message[:code] ?
|
57
|
-
|
58
|
-
mrkdwn: true,
|
59
|
-
thread_ts: message[:thread_ts] || message[:original][:thread_ts]
|
61
|
+
text: message[:code] ? "```\n#{message[:body]}\n```" : resolve_send_mention(message[:body]),
|
62
|
+
mrkdwn: true
|
60
63
|
)
|
64
|
+
client.chat_postMessage(args)
|
61
65
|
end
|
62
66
|
end
|
63
67
|
|
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: 3.2.
|
4
|
+
version: 3.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Kusano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.2.3
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Slack real time messaging adapter for Ruboty
|