ruboty-slack_rtm 3.1.1 → 3.2.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 +9 -4
- data/lib/ruboty/slack_rtm/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bd44ee1547d957dde6233b843c3782ec588d176d82905663b17fec77a414a8d
|
4
|
+
data.tar.gz: 3e35b643ad57dadbdcf903528b19093d1b34199295022296143f2820bf6f33f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea4276ca5f71db7d59fe5d17c8d45f7f69946a41329fc687e7c608c67eec60c5f3f5f58c4f3038d2c4fa8bf3810e21844c3b2dc29b3b92d20e465d539cfa8463
|
7
|
+
data.tar.gz: 88d98fc0232e198c3f0af2ef1ed2915a3ac75d6704f25bedde44631da75cbc36341d8e2cb1efeffce2b81f5e2bd2211429e0eb735cfda921493d1dc7d95ce977
|
@@ -36,7 +36,8 @@ module Ruboty
|
|
36
36
|
parse: message[:parse] || 'full',
|
37
37
|
unfurl_links: true,
|
38
38
|
as_user: true,
|
39
|
-
attachments: message[:attachments].to_json
|
39
|
+
attachments: message[:attachments].to_json,
|
40
|
+
thread_ts: message[:thread_ts] || message[:original][:thread_ts]
|
40
41
|
)
|
41
42
|
elsif message[:file]
|
42
43
|
path = message[:file][:path]
|
@@ -46,14 +47,16 @@ module Ruboty
|
|
46
47
|
file: Faraday::UploadIO.new(path, message[:file][:content_type]),
|
47
48
|
title: message[:file][:title] || path,
|
48
49
|
filename: File.basename(path),
|
49
|
-
initial_comment: message[:body] || ''
|
50
|
+
initial_comment: message[:body] || '',
|
51
|
+
thread_ts: message[:thread_ts] || message[:original][:thread_ts]
|
50
52
|
)
|
51
53
|
else
|
52
54
|
client.chat_postMessage(
|
53
55
|
channel: channel,
|
54
56
|
text: message[:code] ? "```\n#{message[:body]}\n```" : resolve_send_mention(message[:body]),
|
55
57
|
as_user: true,
|
56
|
-
mrkdwn: true
|
58
|
+
mrkdwn: true,
|
59
|
+
thread_ts: message[:thread_ts] || message[:original][:thread_ts]
|
57
60
|
)
|
58
61
|
end
|
59
62
|
end
|
@@ -156,6 +159,8 @@ module Ruboty
|
|
156
159
|
to: channel_to,
|
157
160
|
channel: channel,
|
158
161
|
user: user,
|
162
|
+
ts: data['ts'],
|
163
|
+
thread_ts: data['thread_ts'],
|
159
164
|
time: Time.at(data['ts'].to_f)
|
160
165
|
}
|
161
166
|
|
@@ -237,7 +242,7 @@ module Ruboty
|
|
237
242
|
end
|
238
243
|
|
239
244
|
def resolve_send_mention(text)
|
240
|
-
text = text.to_s
|
245
|
+
text = text.dup.to_s
|
241
246
|
text.gsub!(/@(?<mention>[0-9a-z._-]+)/) do |_|
|
242
247
|
mention = Regexp.last_match[:mention]
|
243
248
|
msg = "@#{mention}"
|
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.
|
4
|
+
version: 3.2.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:
|
11
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -147,8 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
|
151
|
-
rubygems_version: 2.7.6
|
150
|
+
rubygems_version: 3.0.6
|
152
151
|
signing_key:
|
153
152
|
specification_version: 4
|
154
153
|
summary: Slack real time messaging adapter for Ruboty
|