ruboty-slack_rtm 2.3.0 → 2.4.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 +11 -6
- data/lib/ruboty/slack_rtm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7df14a42a9fbf710f494cee00b2fe483416085c2
|
4
|
+
data.tar.gz: fc3cf45180317c08511ceef50193c73f996db918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 907ec5897036d18a1f24b173e5bf503550795820b84109958966a36447b6b72750fac259f58148f771e74862a7ca4ecfce1bee2d3eb631819d5aae71aa8d6317
|
7
|
+
data.tar.gz: 15374cc7a8d10c0186ee70167baf91de71a8dfa2a4d89b78291b494436237154e2a2810b23eb73f0fd3ab046c48629049d5dace7e3dc0df4fcca760c4e833ff4
|
@@ -104,7 +104,7 @@ module Ruboty
|
|
104
104
|
|
105
105
|
channel = channel_info(data['channel'])
|
106
106
|
|
107
|
-
if data['
|
107
|
+
if data['subtype'] == 'bot_message' && ENV['SLACK_IGNORE_BOT_MESSAGE'] == '1'
|
108
108
|
return
|
109
109
|
end
|
110
110
|
|
@@ -116,8 +116,7 @@ module Ruboty
|
|
116
116
|
channel_to = data['channel']
|
117
117
|
end
|
118
118
|
|
119
|
-
|
120
|
-
body: CGI.unescapeHTML(data['text']),
|
119
|
+
message_info = {
|
121
120
|
from: data['channel'],
|
122
121
|
from_name: user['name'],
|
123
122
|
to: channel_to,
|
@@ -125,10 +124,16 @@ module Ruboty
|
|
125
124
|
user: user,
|
126
125
|
mention_to: data['mention_to'],
|
127
126
|
time: Time.at(data['ts'].to_f)
|
128
|
-
|
129
|
-
|
127
|
+
}
|
128
|
+
|
129
|
+
robot.receive(message_info.merge(body: CGI.unescapeHTML(data['text']))
|
130
130
|
|
131
|
-
|
131
|
+
(data['attachments'] || []).each do |attachment|
|
132
|
+
body = (attachments['fallback'] || "#{attachment['text']} #{attachment['pretext']}").to_s
|
133
|
+
|
134
|
+
robot.receive(message_info.merge(body: CGI.unescapeHTML(body)) unless text.empty?
|
135
|
+
end
|
136
|
+
end
|
132
137
|
|
133
138
|
def on_channel_change(data)
|
134
139
|
make_channels_cache
|