slack-ruby-client 0.7.7 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitmodules +1 -1
- data/.travis.yml +3 -3
- data/CHANGELOG.md +14 -2
- data/Dangerfile +1 -1
- data/Gemfile +4 -1
- data/README.md +1 -1
- data/RELEASING.md +2 -2
- data/bin/commands/channels.rb +10 -0
- data/bin/commands/chat.rb +3 -1
- data/bin/commands/groups.rb +10 -0
- data/bin/commands/im.rb +10 -0
- data/bin/commands/mpim.rb +10 -0
- data/bin/commands/team.rb +1 -0
- data/bin/commands/users.rb +20 -0
- data/bin/commands/users_profile.rb +1 -1
- data/examples/new_ticket/new_ticket.rb +1 -1
- data/lib/slack/real_time/concurrency/celluloid.rb +1 -2
- data/lib/slack/real_time/stores/starter.rb +5 -0
- data/lib/slack/real_time/stores/store.rb +5 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/channels.rb +16 -0
- data/lib/slack/web/api/endpoints/chat.rb +5 -1
- data/lib/slack/web/api/endpoints/groups.rb +16 -0
- data/lib/slack/web/api/endpoints/im.rb +16 -0
- data/lib/slack/web/api/endpoints/mpim.rb +16 -0
- data/lib/slack/web/api/endpoints/team.rb +2 -0
- data/lib/slack/web/api/endpoints/users.rb +27 -0
- data/lib/slack/web/api/endpoints/users_profile.rb +1 -1
- data/slack-ruby-client.gemspec +1 -1
- data/spec/slack/web/api/endpoints/im_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/mpim_spec.rb +8 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5793c41e4f30d4ce46c8b5340efb2eb7cff89ca
|
4
|
+
data.tar.gz: 9eef47649e6fb3e914ff2b9f02c3854a0f3dfcd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e40a3979c8bca20a1f2f7415e571c9d40494940094bdb429d7845fa45ca1c5a6a9ba0cc27eb55b54247a847302e161ff0e012140dd8d95cac0b4631af5beeb91
|
7
|
+
data.tar.gz: d69d8327ee9c4eae89a6a85eb653a45c7bb27d038431993e55220661579fdeaf6bafeea64526ce2cde2d255bd8eba903ccc998bcf6dbc407d92f6a77cd9c3bb7
|
data/.gitmodules
CHANGED
data/.travis.yml
CHANGED
@@ -4,12 +4,12 @@ cache: bundler
|
|
4
4
|
|
5
5
|
matrix:
|
6
6
|
include:
|
7
|
-
- rvm: 2.3.
|
7
|
+
- rvm: 2.3.1
|
8
8
|
script:
|
9
9
|
- bundle exec danger
|
10
|
-
- rvm: 2.3.
|
10
|
+
- rvm: 2.3.1
|
11
11
|
env: CONCURRENCY=celluloid-io
|
12
|
-
- rvm: 2.3.
|
12
|
+
- rvm: 2.3.1
|
13
13
|
env: CONCURRENCY=faye-websocket
|
14
14
|
- rvm: 2.2
|
15
15
|
- rvm: 2.1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
### 0.7.8 (1/23/2017)
|
2
|
+
|
3
|
+
* [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `thread_ts` and `reply_broadcast` options to `chat_postMessage` in Web API - [@dblock](https://github.com/dblock).
|
4
|
+
* [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `channels_replies`, `groups_replies` and `im_replies` to Web API - [@dblock](https://github.com/dblock).
|
5
|
+
* [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `goodbye` event to the RTM API - [@dblock](https://github.com/dblock).
|
6
|
+
* [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `before` to `team_accessLogs` - [@dblock](https://github.com/dblock).
|
7
|
+
* [#108](https://github.com/slack-ruby/slack-ruby-client/pull/108): Use slack-ruby-danger gem - [@dblock](https://github.com/dblock).
|
8
|
+
* [#116](https://github.com/slack-ruby/slack-ruby-client/pull/116): Use [slack-ruby/slack-api-ref](https://github.com/slack-ruby/slack-api-ref) as machine API reference - [@dblock](https://github.com/dblock).
|
9
|
+
* [#116](https://github.com/slack-ruby/slack-ruby-client/pull/116): Added `users_setPhoto` and `users_deletePhoto` to Web API - [@dblock](https://github.com/dblock).
|
10
|
+
* [#81](https://github.com/slack-ruby/slack-ruby-client/pull/81): Require faraday 0.9.0 or newer - [@leppert](https://github.com/leppert).
|
11
|
+
* [#123](https://github.com/slack-ruby/slack-ruby-client/pull/123): Fix a warning about duplicate definitions - [@michaelherold](https://github.com/michaelherold).
|
12
|
+
|
1
13
|
### 0.7.7 (8/29/2016)
|
2
14
|
|
3
15
|
* [#103](https://github.com/slack-ruby/slack-ruby-client/pull/103): Added Danger, PR linting - [@dblock](https://github.com/dblock).
|
@@ -19,7 +31,7 @@
|
|
19
31
|
|
20
32
|
### 0.7.4 (5/28/2016)
|
21
33
|
|
22
|
-
* [#93](https://github.com/slack-ruby/slack-ruby-client/pull/93): Fix: When using Celluloid concurrency, handle input from the TCP socket asynchronously from reading more
|
34
|
+
* [#93](https://github.com/slack-ruby/slack-ruby-client/pull/93): Fix: When using Celluloid concurrency, handle input from the TCP socket asynchronously from reading more - [@benzrf](https://github.com/benzrf).
|
23
35
|
* Added `auth_revoke` and `users_identity` to Web API - [@dblock](https://github.com/dblock).
|
24
36
|
* Added `channel` parameter to `files_comments_add` Web API - [@dblock](https://github.com/dblock).
|
25
37
|
|
@@ -59,7 +71,7 @@
|
|
59
71
|
|
60
72
|
* [#45](https://github.com/slack-ruby/slack-ruby-client/issues/45): Added `channels_id`, `groups_id` and `users_id` - [@dblock](https://github.com/dblock).
|
61
73
|
* [#45](https://github.com/slack-ruby/slack-ruby-client/issues/45): Automatically lookup channel, group and user ID in Web API methods when Slack API doesn't accept #channel or @user names - [@dblock](https://github.com/dblock).
|
62
|
-
* [#49](https://github.com/slack-ruby/slack-ruby-client/pull/49): Fix: Celluloid `#connected?` method
|
74
|
+
* [#49](https://github.com/slack-ruby/slack-ruby-client/pull/49): Fix: Celluloid `#connected?` method - [@mikz](https://github.com/mikz), [@kandadaboggu](https://github.com/kandadaboggu).
|
63
75
|
|
64
76
|
### 0.5.3 (1/11/2016)
|
65
77
|
|
data/Dangerfile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
danger.import_dangerfile(gem: 'slack-ruby-danger')
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web) and [RealTime Messa
|
|
18
18
|
|
19
19
|
## Stable Release
|
20
20
|
|
21
|
-
You're reading the documentation for the **stable** release of slack-ruby-client. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
|
21
|
+
You're reading the documentation for the **stable** release of slack-ruby-client, 0.7.8. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
|
22
22
|
|
23
23
|
## Installation
|
24
24
|
|
data/RELEASING.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Releasing Slack-Ruby-Client
|
2
2
|
|
3
|
-
There're no hard rules about when to release slack-ruby-client. Release bug fixes
|
3
|
+
There're no hard rules about when to release slack-ruby-client. Release bug fixes frequently, features not so frequently and breaking API changes rarely.
|
4
4
|
|
5
5
|
### Release
|
6
6
|
|
@@ -60,7 +60,7 @@ Next Release
|
|
60
60
|
|
61
61
|
Increment the third version number in [lib/slack/version.rb](lib/slack/version.rb).
|
62
62
|
|
63
|
-
|
63
|
+
Commit your changes.
|
64
64
|
|
65
65
|
```
|
66
66
|
git add CHANGELOG.md lib/slack/version.rb
|
data/bin/commands/channels.rb
CHANGED
@@ -109,6 +109,16 @@ command 'channels' do |g|
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
+
g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
|
113
|
+
g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
|
114
|
+
g.command 'replies' do |c|
|
115
|
+
c.flag 'channel', desc: 'Channel to fetch thread from.'
|
116
|
+
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
117
|
+
c.action do |_global_options, options, _args|
|
118
|
+
puts JSON.dump($client.channels_replies(options))
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
112
122
|
g.desc 'This method is used to change the purpose of a channel. The calling user must be a member of the channel.'
|
113
123
|
g.long_desc %( This method is used to change the purpose of a channel. The calling user must be a member of the channel. )
|
114
124
|
g.command 'setPurpose' do |c|
|
data/bin/commands/chat.rb
CHANGED
@@ -36,7 +36,9 @@ command 'chat' do |g|
|
|
36
36
|
c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
|
37
37
|
c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.'
|
38
38
|
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
|
39
|
-
c.flag 'icon_emoji', desc: '
|
39
|
+
c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.'
|
40
|
+
c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
|
41
|
+
c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
|
40
42
|
c.action do |_global_options, options, _args|
|
41
43
|
puts JSON.dump($client.chat_postMessage(options))
|
42
44
|
end
|
data/bin/commands/groups.rb
CHANGED
@@ -127,6 +127,16 @@ command 'groups' do |g|
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
+
g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
|
131
|
+
g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
|
132
|
+
g.command 'replies' do |c|
|
133
|
+
c.flag 'channel', desc: 'Private channel to fetch thread from.'
|
134
|
+
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
135
|
+
c.action do |_global_options, options, _args|
|
136
|
+
puts JSON.dump($client.groups_replies(options))
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
130
140
|
g.desc 'This method is used to change the purpose of a private channel. The calling user must be a member of the private channel.'
|
131
141
|
g.long_desc %( This method is used to change the purpose of a private channel. The calling user must be a member of the private channel. )
|
132
142
|
g.command 'setPurpose' do |c|
|
data/bin/commands/im.rb
CHANGED
@@ -51,4 +51,14 @@ command 'im' do |g|
|
|
51
51
|
puts JSON.dump($client.im_open(options))
|
52
52
|
end
|
53
53
|
end
|
54
|
+
|
55
|
+
g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
|
56
|
+
g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
|
57
|
+
g.command 'replies' do |c|
|
58
|
+
c.flag 'channel', desc: 'Direct message channel to fetch thread from.'
|
59
|
+
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
60
|
+
c.action do |_global_options, options, _args|
|
61
|
+
puts JSON.dump($client.im_replies(options))
|
62
|
+
end
|
63
|
+
end
|
54
64
|
end
|
data/bin/commands/mpim.rb
CHANGED
@@ -50,4 +50,14 @@ command 'mpim' do |g|
|
|
50
50
|
puts JSON.dump($client.mpim_open(options))
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
|
55
|
+
g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
|
56
|
+
g.command 'replies' do |c|
|
57
|
+
c.flag 'channel', desc: 'Multiparty direct message channel to fetch thread from.'
|
58
|
+
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
59
|
+
c.action do |_global_options, options, _args|
|
60
|
+
puts JSON.dump($client.mpim_replies(options))
|
61
|
+
end
|
62
|
+
end
|
53
63
|
end
|
data/bin/commands/team.rb
CHANGED
@@ -5,6 +5,7 @@ command 'team' do |g|
|
|
5
5
|
g.desc 'This method is used to get the access logs for users on a team.'
|
6
6
|
g.long_desc %( This method is used to get the access logs for users on a team. )
|
7
7
|
g.command 'accessLogs' do |c|
|
8
|
+
c.flag 'before', desc: 'End of time range of logs to include in results (inclusive).'
|
8
9
|
c.action do |_global_options, options, _args|
|
9
10
|
puts JSON.dump($client.team_accessLogs(options))
|
10
11
|
end
|
data/bin/commands/users.rb
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
desc 'Get info on members of your Slack team.'
|
4
4
|
command 'users' do |g|
|
5
|
+
g.desc 'This method allows the user to delete their profile image. It will clear whatever image is currently set.'
|
6
|
+
g.long_desc %( This method allows the user to delete their profile image. It will clear whatever image is currently set. )
|
7
|
+
g.command 'deletePhoto' do |c|
|
8
|
+
c.action do |_global_options, options, _args|
|
9
|
+
puts JSON.dump($client.users_deletePhoto(options))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
5
13
|
g.desc "This method lets you find out information about a user's presence."
|
6
14
|
g.long_desc %( This method lets you find out information about a user's presence. Consult the presence documentation for more details. )
|
7
15
|
g.command 'getPresence' do |c|
|
@@ -45,6 +53,18 @@ command 'users' do |g|
|
|
45
53
|
end
|
46
54
|
end
|
47
55
|
|
56
|
+
g.desc 'This method allows the user to set their profile image. The caller can pass image data via image.'
|
57
|
+
g.long_desc %( This method allows the user to set their profile image. The caller can pass image data via image. )
|
58
|
+
g.command 'setPhoto' do |c|
|
59
|
+
c.flag 'image', desc: 'File contents via multipart/form-data.'
|
60
|
+
c.flag 'crop_x', desc: 'X coordinate of top-left corner of crop box.'
|
61
|
+
c.flag 'crop_y', desc: 'Y coordinate of top-left corner of crop box.'
|
62
|
+
c.flag 'crop_w', desc: 'Width/height of crop box (always square).'
|
63
|
+
c.action do |_global_options, options, _args|
|
64
|
+
puts JSON.dump($client.users_setPhoto(options))
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
48
68
|
g.desc "This method lets you set the calling user's manual presence."
|
49
69
|
g.long_desc %( This method lets you set the calling user's manual presence. Consult the presence documentation for more details. )
|
50
70
|
g.command 'setPresence' do |c|
|
@@ -15,7 +15,7 @@ command 'users_profile' do |g|
|
|
15
15
|
g.desc 'This method is used to set the profile information for a user.'
|
16
16
|
g.long_desc %( This method is used to set the profile information for a user. )
|
17
17
|
g.command 'set' do |c|
|
18
|
-
c.flag 'user', desc: 'ID of user to change. This argument may only be specified by team admins.'
|
18
|
+
c.flag 'user', desc: 'ID of user to change. This argument may only be specified by team admins on paid teams.'
|
19
19
|
c.flag 'profile', desc: 'Collection of key:value pairs presented as a URL-encoded JSON hash.'
|
20
20
|
c.flag 'name', desc: 'Name of a single key to set. Usable only if profile is not passed.'
|
21
21
|
c.flag 'value', desc: 'Value to set a single key to. Usable only if profile is not passed.'
|
@@ -14,7 +14,7 @@ client.chat_postMessage(
|
|
14
14
|
as_user: true,
|
15
15
|
attachments: [
|
16
16
|
{
|
17
|
-
fallback: "Ticket #1943: Can't
|
17
|
+
fallback: "Ticket #1943: Can't reset my password - https://groove.hq/path/to/ticket/1943",
|
18
18
|
pretext: 'New ticket from Andrea Lee',
|
19
19
|
title: "Ticket #1943: Can't reset my password",
|
20
20
|
title_link: 'https://groove.hq/path/to/ticket/1943',
|
@@ -14,6 +14,11 @@ module Slack
|
|
14
14
|
|
15
15
|
### RealTime Events
|
16
16
|
|
17
|
+
# The server intends to close the connection soon..
|
18
|
+
# @see https://api.slack.com/events/goodbye
|
19
|
+
# @see https://github.com/dblock/slack-api-ref/blob/master/events/goodbye.json
|
20
|
+
# on :goodbye do |data|
|
21
|
+
|
17
22
|
# Verifies ownership of an Events API Request URL.
|
18
23
|
# @see https://api.slack.com/events/url_verification
|
19
24
|
# @see https://github.com/dblock/slack-api-ref/blob/master/events/url_verification.json
|
@@ -54,6 +54,11 @@ module Slack
|
|
54
54
|
|
55
55
|
### RealTime Events
|
56
56
|
|
57
|
+
# The server intends to close the connection soon..
|
58
|
+
# @see https://api.slack.com/events/goodbye
|
59
|
+
# @see https://github.com/dblock/slack-api-ref/blob/master/events/goodbye.json
|
60
|
+
# on :goodbye do |data|
|
61
|
+
|
57
62
|
# Verifies ownership of an Events API Request URL.
|
58
63
|
# @see https://api.slack.com/events/url_verification
|
59
64
|
# @see https://github.com/dblock/slack-api-ref/blob/master/events/url_verification.json
|
data/lib/slack/version.rb
CHANGED
@@ -167,6 +167,22 @@ module Slack
|
|
167
167
|
post('channels.rename', options)
|
168
168
|
end
|
169
169
|
|
170
|
+
#
|
171
|
+
# This method returns an entire thread (a message plus all the messages in reply to it).
|
172
|
+
#
|
173
|
+
# @option options [channel] :channel
|
174
|
+
# Channel to fetch thread from.
|
175
|
+
# @option options [Object] :thread_ts
|
176
|
+
# Unique identifier of a thread's parent message.
|
177
|
+
# @see https://api.slack.com/methods/channels.replies
|
178
|
+
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/channels/channels.replies.json
|
179
|
+
def channels_replies(options = {})
|
180
|
+
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
181
|
+
throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
|
182
|
+
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
183
|
+
post('channels.replies', options)
|
184
|
+
end
|
185
|
+
|
170
186
|
#
|
171
187
|
# This method is used to change the purpose of a channel. The calling user must be a member of the channel.
|
172
188
|
#
|
@@ -62,7 +62,11 @@ module Slack
|
|
62
62
|
# @option options [Object] :icon_url
|
63
63
|
# URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
|
64
64
|
# @option options [Object] :icon_emoji
|
65
|
-
#
|
65
|
+
# Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
|
66
|
+
# @option options [Object] :thread_ts
|
67
|
+
# Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead.
|
68
|
+
# @option options [Object] :reply_broadcast
|
69
|
+
# Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.
|
66
70
|
# @see https://api.slack.com/methods/chat.postMessage
|
67
71
|
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
|
68
72
|
def chat_postMessage(options = {})
|
@@ -196,6 +196,22 @@ module Slack
|
|
196
196
|
post('groups.rename', options)
|
197
197
|
end
|
198
198
|
|
199
|
+
#
|
200
|
+
# This method returns an entire thread (a message plus all the messages in reply to it).
|
201
|
+
#
|
202
|
+
# @option options [group] :channel
|
203
|
+
# Private channel to fetch thread from.
|
204
|
+
# @option options [Object] :thread_ts
|
205
|
+
# Unique identifier of a thread's parent message.
|
206
|
+
# @see https://api.slack.com/methods/groups.replies
|
207
|
+
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.replies.json
|
208
|
+
def groups_replies(options = {})
|
209
|
+
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
210
|
+
throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
|
211
|
+
options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
|
212
|
+
post('groups.replies', options)
|
213
|
+
end
|
214
|
+
|
199
215
|
#
|
200
216
|
# This method is used to change the purpose of a private channel. The calling user must be a member of the private channel.
|
201
217
|
#
|
@@ -80,6 +80,22 @@ module Slack
|
|
80
80
|
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
81
81
|
post('im.open', options)
|
82
82
|
end
|
83
|
+
|
84
|
+
#
|
85
|
+
# This method returns an entire thread (a message plus all the messages in reply to it).
|
86
|
+
#
|
87
|
+
# @option options [im] :channel
|
88
|
+
# Direct message channel to fetch thread from.
|
89
|
+
# @option options [Object] :thread_ts
|
90
|
+
# Unique identifier of a thread's parent message.
|
91
|
+
# @see https://api.slack.com/methods/im.replies
|
92
|
+
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/im/im.replies.json
|
93
|
+
def im_replies(options = {})
|
94
|
+
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
95
|
+
throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
|
96
|
+
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
97
|
+
post('im.replies', options)
|
98
|
+
end
|
83
99
|
end
|
84
100
|
end
|
85
101
|
end
|
@@ -77,6 +77,22 @@ module Slack
|
|
77
77
|
throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
|
78
78
|
post('mpim.open', options)
|
79
79
|
end
|
80
|
+
|
81
|
+
#
|
82
|
+
# This method returns an entire thread (a message plus all the messages in reply to it).
|
83
|
+
#
|
84
|
+
# @option options [channel] :channel
|
85
|
+
# Multiparty direct message channel to fetch thread from.
|
86
|
+
# @option options [Object] :thread_ts
|
87
|
+
# Unique identifier of a thread's parent message.
|
88
|
+
# @see https://api.slack.com/methods/mpim.replies
|
89
|
+
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/mpim/mpim.replies.json
|
90
|
+
def mpim_replies(options = {})
|
91
|
+
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
92
|
+
throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
|
93
|
+
options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
|
94
|
+
post('mpim.replies', options)
|
95
|
+
end
|
80
96
|
end
|
81
97
|
end
|
82
98
|
end
|
@@ -8,6 +8,8 @@ module Slack
|
|
8
8
|
#
|
9
9
|
# This method is used to get the access logs for users on a team.
|
10
10
|
#
|
11
|
+
# @option options [Object] :before
|
12
|
+
# End of time range of logs to include in results (inclusive).
|
11
13
|
# @see https://api.slack.com/methods/team.accessLogs
|
12
14
|
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/team/team.accessLogs.json
|
13
15
|
def team_accessLogs(options = {})
|
@@ -5,6 +5,15 @@ module Slack
|
|
5
5
|
module Api
|
6
6
|
module Endpoints
|
7
7
|
module Users
|
8
|
+
#
|
9
|
+
# This method allows the user to delete their profile image. It will clear whatever image is currently set.
|
10
|
+
#
|
11
|
+
# @see https://api.slack.com/methods/users.deletePhoto
|
12
|
+
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/users/users.deletePhoto.json
|
13
|
+
def users_deletePhoto(options = {})
|
14
|
+
post('users.deletePhoto', options)
|
15
|
+
end
|
16
|
+
|
8
17
|
#
|
9
18
|
# This method lets you find out information about a user's presence.
|
10
19
|
# Consult the presence documentation for more details.
|
@@ -63,6 +72,24 @@ module Slack
|
|
63
72
|
post('users.setActive', options)
|
64
73
|
end
|
65
74
|
|
75
|
+
#
|
76
|
+
# This method allows the user to set their profile image. The caller can pass image data via image.
|
77
|
+
#
|
78
|
+
# @option options [Object] :image
|
79
|
+
# File contents via multipart/form-data.
|
80
|
+
# @option options [Object] :crop_x
|
81
|
+
# X coordinate of top-left corner of crop box.
|
82
|
+
# @option options [Object] :crop_y
|
83
|
+
# Y coordinate of top-left corner of crop box.
|
84
|
+
# @option options [Object] :crop_w
|
85
|
+
# Width/height of crop box (always square).
|
86
|
+
# @see https://api.slack.com/methods/users.setPhoto
|
87
|
+
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/users/users.setPhoto.json
|
88
|
+
def users_setPhoto(options = {})
|
89
|
+
throw ArgumentError.new('Required arguments :image missing') if options[:image].nil?
|
90
|
+
post('users.setPhoto', options)
|
91
|
+
end
|
92
|
+
|
66
93
|
#
|
67
94
|
# This method lets you set the calling user's manual presence.
|
68
95
|
# Consult the presence documentation for more details.
|
@@ -23,7 +23,7 @@ module Slack
|
|
23
23
|
# This method is used to set the profile information for a user.
|
24
24
|
#
|
25
25
|
# @option options [user] :user
|
26
|
-
# ID of user to change. This argument may only be specified by team admins.
|
26
|
+
# ID of user to change. This argument may only be specified by team admins on paid teams.
|
27
27
|
# @option options [Object] :profile
|
28
28
|
# Collection of key:value pairs presented as a URL-encoded JSON hash.
|
29
29
|
# @option options [Object] :name
|
data/slack-ruby-client.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.licenses = ['MIT']
|
18
18
|
s.summary = 'Slack Web and RealTime API client.'
|
19
19
|
s.add_dependency 'activesupport'
|
20
|
-
s.add_dependency 'faraday'
|
20
|
+
s.add_dependency 'faraday', '>= 0.9'
|
21
21
|
s.add_dependency 'faraday_middleware'
|
22
22
|
s.add_dependency 'json'
|
23
23
|
s.add_dependency 'websocket-driver'
|
@@ -27,4 +27,12 @@ RSpec.describe Slack::Web::Api::Endpoints::Im do
|
|
27
27
|
expect { client.im_open }.to raise_error ArgumentError, /Required arguments :user missing/
|
28
28
|
end
|
29
29
|
end
|
30
|
+
context 'im_replies' do
|
31
|
+
it 'requires channel' do
|
32
|
+
expect { client.im_replies(thread_ts: '1234567890.123456') }.to raise_error ArgumentError, /Required arguments :channel missing/
|
33
|
+
end
|
34
|
+
it 'requires thread_ts' do
|
35
|
+
expect { client.im_replies(channel: 'C1234567890') }.to raise_error ArgumentError, /Required arguments :thread_ts missing/
|
36
|
+
end
|
37
|
+
end
|
30
38
|
end
|
@@ -27,4 +27,12 @@ RSpec.describe Slack::Web::Api::Endpoints::Mpim do
|
|
27
27
|
expect { client.mpim_open }.to raise_error ArgumentError, /Required arguments :users missing/
|
28
28
|
end
|
29
29
|
end
|
30
|
+
context 'mpim_replies' do
|
31
|
+
it 'requires channel' do
|
32
|
+
expect { client.mpim_replies(thread_ts: '1234567890.123456') }.to raise_error ArgumentError, /Required arguments :channel missing/
|
33
|
+
end
|
34
|
+
it 'requires thread_ts' do
|
35
|
+
expect { client.mpim_replies(channel: 'C1234567890') }.to raise_error ArgumentError, /Required arguments :thread_ts missing/
|
36
|
+
end
|
37
|
+
end
|
30
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Doubrovkine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '0.9'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '0.9'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: faraday_middleware
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -449,7 +449,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
449
449
|
version: 1.3.6
|
450
450
|
requirements: []
|
451
451
|
rubyforge_project:
|
452
|
-
rubygems_version: 2.
|
452
|
+
rubygems_version: 2.6.8
|
453
453
|
signing_key:
|
454
454
|
specification_version: 4
|
455
455
|
summary: Slack Web and RealTime API client.
|