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 +4 -4
- data/lib/slacks/connection.rb +15 -0
- data/lib/slacks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1385dd16f098666b0fa17c46fa177bcad2ae1602
|
4
|
+
data.tar.gz: ee7310ebdbe83f6db147b4a73ec958e2db6e0afe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0f15cfaa115fc220b53da103297e5c57933cc52c01f4b9ef1170b468d2227decb798ff76d407a370f03362069c2728ad3798c3af840aed8ec79e18408fda635
|
7
|
+
data.tar.gz: 5c3b99a3fbd3776cdd47f4b4b60d8d8959f1df732735e1aaa19c628ff876296debb75b972da78a173a8f6f4910a2bb415e78315702f486a6cc44f202289a995a
|
data/lib/slacks/connection.rb
CHANGED
@@ -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", {
|
data/lib/slacks/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: websocket-driver
|