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: 2dcd98854d9802c80d92d7e30a0664e08c20d52c018e0c002198c03cf0ab28df
4
- data.tar.gz: 3349bee5d5d493039bcd854ca87ef105dd1286dd39dc0b933d81c025d627dd97
3
+ metadata.gz: 4122589df509c322716a0fca06d9b11cb113efe3d8700ca22066924e7f958f99
4
+ data.tar.gz: 64ae8e60524c57343c6606ce8b277c32c9c125d46d941d7e982c2fb65680f92d
5
5
  SHA512:
6
- metadata.gz: 4b48b80274a8964da2e4441b806997a0641b8236375517a76f70cc7c26dfe3b1295e76063ae04faac01d079a9b9072ff3738a5bc16dce81f6533c813bb4b58ac
7
- data.tar.gz: f58de517b4c83ae6b0ddb9b6a482cd93eeaa48a43001eab57fca8a3134d6ee07bb3cd2b609dd31f7bca23fffab8e8d3ec5f3f541d83132bf41ed015c541d98cd
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
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module SlackReactionAdded
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-slack_reaction_added
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - srz_zumix