slacks 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 40d731ac92fa1fc207c6723ab3986302416c481f
4
- data.tar.gz: 3e03fdfdd979b06b9103f4773f59225a0d8dde7b
3
+ metadata.gz: 1385dd16f098666b0fa17c46fa177bcad2ae1602
4
+ data.tar.gz: ee7310ebdbe83f6db147b4a73ec958e2db6e0afe
5
5
  SHA512:
6
- metadata.gz: f0360f432a06a1cfe599e8e246e87ce26e29f301574a3dc376f498c06a4c126cb6f6a4a1127af7001e37595a9756033665fc9df6433e3172156c07b84f6b0ab2
7
- data.tar.gz: d5f46535abe6b9ce02298b41585fe8fe729bf355f910aa251d430d5b22449f4688e2ddf287dd1380ffa626b7d437a72745eb91efb39758d0819e1b0c2c66ab47
6
+ metadata.gz: e0f15cfaa115fc220b53da103297e5c57933cc52c01f4b9ef1170b468d2227decb798ff76d407a370f03362069c2728ad3798c3af840aed8ec79e18408fda635
7
+ data.tar.gz: 5c3b99a3fbd3776cdd47f4b4b60d8d8959f1df732735e1aaa19c628ff876296debb75b972da78a173a8f6f4910a2bb415e78315702f486a6cc44f202289a995a
@@ -48,6 +48,21 @@ module Slacks
48
48
  end
49
49
  alias :say :send_message
50
50
 
51
+ def update_message(ts, message, options={})
52
+ channel = options.fetch(:channel) { raise ArgumentError, "Missing parameter :channel" }
53
+ attachments = Array(options[:attachments])
54
+ params = {
55
+ ts: ts,
56
+ channel: to_channel_id(channel),
57
+ text: message,
58
+ as_user: true, # post as the authenticated user (rather than as slackbot)
59
+ link_names: 1} # find and link channel names and user names
60
+ params.merge!(attachments: MultiJson.dump(attachments)) if attachments.any?
61
+ params.merge!(options.select { |key, _| [:username, :as_user, :parse, :link_names,
62
+ :unfurl_links, :unfurl_media, :icon_url, :icon_emoji].member?(key) })
63
+ api("chat.update", params)
64
+ end
65
+
51
66
  def add_reaction(emojis, message)
52
67
  Array(emojis).each do |emoji|
53
68
  api("reactions.add", {
@@ -1,3 +1,3 @@
1
1
  module Slacks
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slacks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Lail
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: websocket-driver