ruboty-slack_reaction_added 0.1.0 → 0.2.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4122589df509c322716a0fca06d9b11cb113efe3d8700ca22066924e7f958f99
|
4
|
+
data.tar.gz: 64ae8e60524c57343c6606ce8b277c32c9c125d46d941d7e982c2fb65680f92d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40b1d855d6d5e3c55e71751bc7d259bb6dc77534a6f0fae0a1aa74df41a098355f04008bb19c517209f67af3671519bdde77faf760b271cc907cd2dc294c8414
|
7
|
+
data.tar.gz: b8ae5454c3bf7656246b39a36afa2ed8e8582e6645285c64fcdeb2b0cc17971c69d82c142a928dfa64b7595c687d9f53934e90e0e49a2bdb4d8ab1ae41b6f781
|
@@ -8,8 +8,6 @@ module Ruboty
|
|
8
8
|
channel = data['item']['channel']
|
9
9
|
histories = @client.conversations_history(channel: channel, latest: data['item']['ts'], inclusive: true, limit: 1)
|
10
10
|
message = histories['messages'][0]
|
11
|
-
permalink = @client.chat_getPermalink(channel: channel, message_ts: data['item']['ts'])
|
12
|
-
message['permalink'] = permalink['permalink']
|
13
11
|
message['channel'] = channel
|
14
12
|
message['reaction_added'] = data
|
15
13
|
# Ruboty.logger.info message
|
@@ -60,6 +58,19 @@ module Ruboty
|
|
60
58
|
end
|
61
59
|
end
|
62
60
|
end
|
61
|
+
|
62
|
+
def channel_info(channel_id)
|
63
|
+
@channel_info_caches[channel_id] ||= begin
|
64
|
+
resp = case channel_id
|
65
|
+
when /^C/, /^D/, /^G/
|
66
|
+
client.conversations_info(channel: channel_id)
|
67
|
+
else
|
68
|
+
{}
|
69
|
+
end
|
70
|
+
|
71
|
+
resp['channel']
|
72
|
+
end
|
73
|
+
end
|
63
74
|
end
|
64
75
|
|
65
76
|
prepend ReactionAddedSlackRTM
|
@@ -8,6 +8,11 @@ module Ruboty
|
|
8
8
|
robot.add_reaction(reaction, channel_id, timestamp)
|
9
9
|
end
|
10
10
|
|
11
|
+
def permalink
|
12
|
+
permalink = @client.chat_getPermalink(channel: @original[:channel]["id"], message_ts: @original[:ts])
|
13
|
+
permalink['permalink']
|
14
|
+
end
|
15
|
+
|
11
16
|
def reaction
|
12
17
|
@original[:reaction]
|
13
18
|
end
|