slack-ruby-client 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -8
  3. data/CHANGELOG.md +4 -0
  4. data/README.md +1 -1
  5. data/bin/commands.rb +1 -0
  6. data/bin/commands/api.rb +2 -2
  7. data/bin/commands/apps_permissions.rb +22 -0
  8. data/bin/commands/auth.rb +4 -4
  9. data/bin/commands/bots.rb +2 -2
  10. data/bin/commands/channels.rb +31 -31
  11. data/bin/commands/chat.rb +40 -23
  12. data/bin/commands/dnd.rb +8 -8
  13. data/bin/commands/emoji.rb +2 -2
  14. data/bin/commands/files.rb +17 -17
  15. data/bin/commands/files_comments.rb +6 -6
  16. data/bin/commands/groups.rb +36 -35
  17. data/bin/commands/im.rb +13 -13
  18. data/bin/commands/mpim.rb +11 -11
  19. data/bin/commands/oauth.rb +15 -2
  20. data/bin/commands/pins.rb +6 -6
  21. data/bin/commands/reactions.rb +13 -13
  22. data/bin/commands/reminders.rb +10 -10
  23. data/bin/commands/rtm.rb +10 -6
  24. data/bin/commands/search.rb +9 -9
  25. data/bin/commands/stars.rb +8 -8
  26. data/bin/commands/team.rb +10 -10
  27. data/bin/commands/team_profile.rb +2 -2
  28. data/bin/commands/usergroups.rb +16 -16
  29. data/bin/commands/usergroups_users.rb +4 -4
  30. data/bin/commands/users.rb +20 -18
  31. data/bin/commands/users_profile.rb +7 -7
  32. data/lib/slack/real_time/stores/starter.rb +20 -0
  33. data/lib/slack/real_time/stores/store.rb +20 -0
  34. data/lib/slack/version.rb +1 -1
  35. data/lib/slack/web/api/endpoints.rb +2 -0
  36. data/lib/slack/web/api/endpoints/api.rb +1 -1
  37. data/lib/slack/web/api/endpoints/apps_permissions.rb +35 -0
  38. data/lib/slack/web/api/endpoints/auth.rb +2 -2
  39. data/lib/slack/web/api/endpoints/bots.rb +1 -1
  40. data/lib/slack/web/api/endpoints/channels.rb +17 -18
  41. data/lib/slack/web/api/endpoints/chat.rb +67 -30
  42. data/lib/slack/web/api/endpoints/dnd.rb +4 -4
  43. data/lib/slack/web/api/endpoints/emoji.rb +1 -1
  44. data/lib/slack/web/api/endpoints/files.rb +16 -17
  45. data/lib/slack/web/api/endpoints/files_comments.rb +8 -8
  46. data/lib/slack/web/api/endpoints/groups.rb +21 -22
  47. data/lib/slack/web/api/endpoints/im.rb +8 -10
  48. data/lib/slack/web/api/endpoints/mpim.rb +7 -9
  49. data/lib/slack/web/api/endpoints/oauth.rb +23 -2
  50. data/lib/slack/web/api/endpoints/pins.rb +3 -5
  51. data/lib/slack/web/api/endpoints/reactions.rb +14 -16
  52. data/lib/slack/web/api/endpoints/reminders.rb +5 -5
  53. data/lib/slack/web/api/endpoints/rtm.rb +14 -6
  54. data/lib/slack/web/api/endpoints/search.rb +9 -9
  55. data/lib/slack/web/api/endpoints/stars.rb +7 -9
  56. data/lib/slack/web/api/endpoints/team.rb +8 -9
  57. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  58. data/lib/slack/web/api/endpoints/usergroups.rb +17 -17
  59. data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
  60. data/lib/slack/web/api/endpoints/users.rb +15 -15
  61. data/lib/slack/web/api/endpoints/users_profile.rb +8 -8
  62. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +4 -3
  63. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +17 -0
  64. data/spec/integration/integration_spec.rb +1 -1
  65. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +15 -0
  66. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +37 -1
  67. data/spec/slack/web/api/endpoints/files_comments_spec.rb +8 -8
  68. data/spec/slack/web/api/endpoints/files_spec.rb +0 -5
  69. data/spec/slack/web/api/endpoints/oauth_spec.rb +11 -0
  70. metadata +7 -2
@@ -6,7 +6,7 @@ module Slack
6
6
  module Endpoints
7
7
  module Dnd
8
8
  #
9
- # Ends the user's currently scheduled Do Not Disturb session immediately.
9
+ # Ends the current user's Do Not Disturb session immediately.
10
10
  #
11
11
  # @see https://api.slack.com/methods/dnd.endDnd
12
12
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/dnd/dnd.endDnd.json
@@ -24,7 +24,7 @@ module Slack
24
24
  end
25
25
 
26
26
  #
27
- # Provides information about a user's current Do Not Disturb settings.
27
+ # Retrieves a user's current Do Not Disturb status.
28
28
  #
29
29
  # @option options [user] :user
30
30
  # User to fetch status for (defaults to current user).
@@ -36,7 +36,7 @@ module Slack
36
36
  end
37
37
 
38
38
  #
39
- # Adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration.
39
+ # Turns on Do Not Disturb mode for the current user, or changes its duration.
40
40
  #
41
41
  # @option options [Object] :num_minutes
42
42
  # Number of minutes, from now, to snooze until.
@@ -48,7 +48,7 @@ module Slack
48
48
  end
49
49
 
50
50
  #
51
- # Provides information about the current Do Not Disturb settings for users of a Slack team.
51
+ # Retrieves the Do Not Disturb status for users on a team.
52
52
  #
53
53
  # @option options [Object] :users
54
54
  # Comma-separated list of users to fetch Do Not Disturb status for.
@@ -6,7 +6,7 @@ module Slack
6
6
  module Endpoints
7
7
  module Emoji
8
8
  #
9
- # This method lists the custom emoji for a team.
9
+ # Lists custom emoji for a team.
10
10
  #
11
11
  # @see https://api.slack.com/methods/emoji.list
12
12
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/emoji/emoji.list.json
@@ -6,7 +6,7 @@ module Slack
6
6
  module Endpoints
7
7
  module Files
8
8
  #
9
- # This method deletes a file from your team.
9
+ # Deletes a file.
10
10
  #
11
11
  # @option options [file] :file
12
12
  # ID of file to delete.
@@ -18,7 +18,7 @@ module Slack
18
18
  end
19
19
 
20
20
  #
21
- # This method returns information about a file in your team.
21
+ # Gets information about a team file.
22
22
  #
23
23
  # @option options [file] :file
24
24
  # Specify a file by providing its ID.
@@ -30,10 +30,8 @@ module Slack
30
30
  end
31
31
 
32
32
  #
33
- # This method returns a list of files within the team. It can be filtered and sliced in various ways.
33
+ # Lists & filters team files.
34
34
  #
35
- # @option options [user] :user
36
- # Filter files created by a single user.
37
35
  # @option options [channel] :channel
38
36
  # Filter files appearing in a specific channel, indicated by its ID.
39
37
  # @option options [Object] :ts_from
@@ -54,6 +52,8 @@ module Slack
54
52
  #
55
53
  # You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.
56
54
  # .
55
+ # @option options [user] :user
56
+ # Filter files created by a single user.
57
57
  # @see https://api.slack.com/methods/files.list
58
58
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files/files.list.json
59
59
  def files_list(options = {})
@@ -63,7 +63,7 @@ module Slack
63
63
  end
64
64
 
65
65
  #
66
- # This method disables public/external sharing for a file.
66
+ # Revokes public/external sharing access for a file
67
67
  #
68
68
  # @option options [file] :file
69
69
  # File to revoke.
@@ -75,7 +75,7 @@ module Slack
75
75
  end
76
76
 
77
77
  #
78
- # This method enables public/external sharing for a file.
78
+ # Enables a file for public/external sharing.
79
79
  #
80
80
  # @option options [file] :file
81
81
  # File to share.
@@ -87,26 +87,25 @@ module Slack
87
87
  end
88
88
 
89
89
  #
90
- # This method allows you to create or upload an existing file.
90
+ # Uploads or creates a file.
91
91
  #
92
- # @option options [file] :file
93
- # File contents via multipart/form-data. If omitting this parameter, you must submit content.
92
+ # @option options [Object] :channels
93
+ # Comma-separated list of channel names or IDs where the file will be shared.
94
94
  # @option options [Object] :content
95
95
  # File contents via a POST variable. If omitting this parameter, you must provide a file.
96
- # @option options [Object] :filetype
97
- # A file type identifier.
96
+ # @option options [file] :file
97
+ # File contents via multipart/form-data. If omitting this parameter, you must submit content.
98
98
  # @option options [Object] :filename
99
99
  # Filename of file.
100
- # @option options [Object] :title
101
- # Title of file.
100
+ # @option options [Object] :filetype
101
+ # A file type identifier.
102
102
  # @option options [Object] :initial_comment
103
103
  # Initial comment to add to file.
104
- # @option options [Object] :channels
105
- # Comma-separated list of channel names or IDs where the file will be shared.
104
+ # @option options [Object] :title
105
+ # Title of file.
106
106
  # @see https://api.slack.com/methods/files.upload
107
107
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files/files.upload.json
108
108
  def files_upload(options = {})
109
- throw ArgumentError.new('Required arguments :filename missing') if options[:filename].nil?
110
109
  post('files.upload', options)
111
110
  end
112
111
  end
@@ -8,20 +8,20 @@ module Slack
8
8
  #
9
9
  # Add a comment to an existing file.
10
10
  #
11
- # @option options [file] :file
12
- # File to add a comment to.
13
11
  # @option options [Object] :comment
14
12
  # Text of the comment to add.
13
+ # @option options [file] :file
14
+ # File to add a comment to.
15
15
  # @see https://api.slack.com/methods/files.comments.add
16
16
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.comments/files.comments.add.json
17
17
  def files_comments_add(options = {})
18
- throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
19
18
  throw ArgumentError.new('Required arguments :comment missing') if options[:comment].nil?
19
+ throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
20
20
  post('files.comments.add', options)
21
21
  end
22
22
 
23
23
  #
24
- # Delete an existing comment on a file. Only the original author of the comment or a Team Administrator may delete a file comment.
24
+ # Deletes an existing comment on a file.
25
25
  #
26
26
  # @option options [file] :file
27
27
  # File to delete a comment from.
@@ -36,20 +36,20 @@ module Slack
36
36
  end
37
37
 
38
38
  #
39
- # Edit an existing comment on a file. Only the user who created a comment may make edits. Teams may configure a limited time window during which file comment edits are allowed.
39
+ # Edit an existing file comment.
40
40
  #
41
+ # @option options [Object] :comment
42
+ # Text of the comment to edit.
41
43
  # @option options [file] :file
42
44
  # File containing the comment to edit.
43
45
  # @option options [Object] :id
44
46
  # The comment to edit.
45
- # @option options [Object] :comment
46
- # Text of the comment to edit.
47
47
  # @see https://api.slack.com/methods/files.comments.edit
48
48
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/files.comments/files.comments.edit.json
49
49
  def files_comments_edit(options = {})
50
+ throw ArgumentError.new('Required arguments :comment missing') if options[:comment].nil?
50
51
  throw ArgumentError.new('Required arguments :file missing') if options[:file].nil?
51
52
  throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
52
- throw ArgumentError.new('Required arguments :comment missing') if options[:comment].nil?
53
53
  post('files.comments.edit', options)
54
54
  end
55
55
  end
@@ -6,7 +6,7 @@ module Slack
6
6
  module Endpoints
7
7
  module Groups
8
8
  #
9
- # This method archives a private channel.
9
+ # Archives a private channel.
10
10
  #
11
11
  # @option options [group] :channel
12
12
  # Private channel to archive.
@@ -19,7 +19,7 @@ module Slack
19
19
  end
20
20
 
21
21
  #
22
- # This method closes a private channel.
22
+ # Closes a private channel.
23
23
  #
24
24
  # @option options [group] :channel
25
25
  # Private channel to close.
@@ -32,7 +32,7 @@ module Slack
32
32
  end
33
33
 
34
34
  #
35
- # This method creates a private channel.
35
+ # Creates a private channel.
36
36
  #
37
37
  # @option options [Object] :name
38
38
  # Name of private channel to create.
@@ -46,7 +46,7 @@ module Slack
46
46
  end
47
47
 
48
48
  #
49
- # This method takes an existing private channel and performs the following steps:
49
+ # Clones and archives a private channel.
50
50
  #
51
51
  # @option options [group] :channel
52
52
  # Private channel to clone and archive.
@@ -59,18 +59,16 @@ module Slack
59
59
  end
60
60
 
61
61
  #
62
- # This method returns a portion of messages/events from the specified private channel.
63
- # To read the entire history for a private channel, call the method with no latest or
64
- # oldest arguments, and then continue paging using the instructions below.
62
+ # Fetches history of messages and events from a private channel.
65
63
  #
66
64
  # @option options [group] :channel
67
65
  # Private channel to fetch history for.
66
+ # @option options [Object] :inclusive
67
+ # Include messages with latest or oldest timestamp in results.
68
68
  # @option options [timestamp] :latest
69
69
  # End of time range of messages to include in results.
70
70
  # @option options [timestamp] :oldest
71
71
  # Start of time range of messages to include in results.
72
- # @option options [Object] :inclusive
73
- # Include messages with latest or oldest timestamp in results.
74
72
  # @option options [Object] :unreads
75
73
  # Include unread_count_display in the output?.
76
74
  # @see https://api.slack.com/methods/groups.history
@@ -82,7 +80,7 @@ module Slack
82
80
  end
83
81
 
84
82
  #
85
- # This method returns information about a private channel.
83
+ # Gets information about a private channel.
86
84
  #
87
85
  # @option options [group] :channel
88
86
  # Private channel to get info on.
@@ -95,7 +93,7 @@ module Slack
95
93
  end
96
94
 
97
95
  #
98
- # This method is used to invite a user to a private channel. The calling user must be a member of the private channel.
96
+ # Invites a user to a private channel.
99
97
  #
100
98
  # @option options [group] :channel
101
99
  # Private channel to invite user to.
@@ -112,7 +110,7 @@ module Slack
112
110
  end
113
111
 
114
112
  #
115
- # This method allows a user to remove another member from a private channel.
113
+ # Removes a user from a private channel.
116
114
  #
117
115
  # @option options [group] :channel
118
116
  # Private channel to remove user from.
@@ -129,7 +127,7 @@ module Slack
129
127
  end
130
128
 
131
129
  #
132
- # This method is used to leave a private channel.
130
+ # Leaves a private channel.
133
131
  #
134
132
  # @option options [group] :channel
135
133
  # Private channel to leave.
@@ -142,11 +140,12 @@ module Slack
142
140
  end
143
141
 
144
142
  #
145
- # This method returns a list of private channels in the team that the caller is in and archived groups that the caller was in.
146
- # The list of (non-deactivated) members in each private channel is also returned.
143
+ # Lists private channels that the calling user has access to.
147
144
  #
148
145
  # @option options [Object] :exclude_archived
149
146
  # Don't return archived private channels.
147
+ # @option options [Object] :exclude_members
148
+ # Exlude the members from each group.
150
149
  # @see https://api.slack.com/methods/groups.list
151
150
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/groups/groups.list.json
152
151
  def groups_list(options = {})
@@ -154,7 +153,7 @@ module Slack
154
153
  end
155
154
 
156
155
  #
157
- # This method moves the read cursor in a private channel.
156
+ # Sets the read cursor in a private channel.
158
157
  #
159
158
  # @option options [group] :channel
160
159
  # Private channel to set reading cursor in.
@@ -170,7 +169,7 @@ module Slack
170
169
  end
171
170
 
172
171
  #
173
- # This method opens a private channel.
172
+ # Opens a private channel.
174
173
  #
175
174
  # @option options [group] :channel
176
175
  # Private channel to open.
@@ -183,7 +182,7 @@ module Slack
183
182
  end
184
183
 
185
184
  #
186
- # This method renames a private channel.
185
+ # Renames a private channel.
187
186
  #
188
187
  # @option options [group] :channel
189
188
  # Private channel to rename.
@@ -201,7 +200,7 @@ module Slack
201
200
  end
202
201
 
203
202
  #
204
- # This method returns an entire thread (a message plus all the messages in reply to it).
203
+ # Retrieve a thread of messages posted to a private channel
205
204
  #
206
205
  # @option options [group] :channel
207
206
  # Private channel to fetch thread from.
@@ -217,7 +216,7 @@ module Slack
217
216
  end
218
217
 
219
218
  #
220
- # This method is used to change the purpose of a private channel. The calling user must be a member of the private channel.
219
+ # Sets the purpose for a private channel.
221
220
  #
222
221
  # @option options [group] :channel
223
222
  # Private channel to set the purpose of.
@@ -233,7 +232,7 @@ module Slack
233
232
  end
234
233
 
235
234
  #
236
- # This method is used to change the topic of a private channel. The calling user must be a member of the private channel.
235
+ # Sets the topic for a private channel.
237
236
  #
238
237
  # @option options [group] :channel
239
238
  # Private channel to set the topic of.
@@ -249,7 +248,7 @@ module Slack
249
248
  end
250
249
 
251
250
  #
252
- # This method unarchives a private channel.
251
+ # Unarchives a private channel.
253
252
  #
254
253
  # @option options [group] :channel
255
254
  # Private channel to unarchive.
@@ -6,7 +6,7 @@ module Slack
6
6
  module Endpoints
7
7
  module Im
8
8
  #
9
- # This method closes a direct message channel.
9
+ # Close a direct message channel.
10
10
  #
11
11
  # @option options [im] :channel
12
12
  # Direct message channel to close.
@@ -19,18 +19,16 @@ module Slack
19
19
  end
20
20
 
21
21
  #
22
- # This method returns a portion of messages/events from the specified direct message channel.
23
- # To read the entire history for a direct message channel, call the method with no latest or
24
- # oldest arguments, and then continue paging using the instructions below.
22
+ # Fetches history of messages and events from direct message channel.
25
23
  #
26
24
  # @option options [im] :channel
27
25
  # Direct message channel to fetch history for.
26
+ # @option options [Object] :inclusive
27
+ # Include messages with latest or oldest timestamp in results.
28
28
  # @option options [timestamp] :latest
29
29
  # End of time range of messages to include in results.
30
30
  # @option options [timestamp] :oldest
31
31
  # Start of time range of messages to include in results.
32
- # @option options [Object] :inclusive
33
- # Include messages with latest or oldest timestamp in results.
34
32
  # @option options [Object] :unreads
35
33
  # Include unread_count_display in the output?.
36
34
  # @see https://api.slack.com/methods/im.history
@@ -42,7 +40,7 @@ module Slack
42
40
  end
43
41
 
44
42
  #
45
- # This method returns a list of all im channels that the user has.
43
+ # Lists direct message channels for the calling user.
46
44
  #
47
45
  # @see https://api.slack.com/methods/im.list
48
46
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/im/im.list.json
@@ -51,7 +49,7 @@ module Slack
51
49
  end
52
50
 
53
51
  #
54
- # This method moves the read cursor in a direct message channel.
52
+ # Sets the read cursor in a direct message channel.
55
53
  #
56
54
  # @option options [im] :channel
57
55
  # Direct message channel to set reading cursor in.
@@ -67,7 +65,7 @@ module Slack
67
65
  end
68
66
 
69
67
  #
70
- # This method opens a direct message channel with another member of your Slack team.
68
+ # Opens a direct message channel.
71
69
  #
72
70
  # @option options [user] :user
73
71
  # User to open a direct message channel with.
@@ -82,7 +80,7 @@ module Slack
82
80
  end
83
81
 
84
82
  #
85
- # This method returns an entire thread (a message plus all the messages in reply to it).
83
+ # Retrieve a thread of messages posted to a direct message conversation
86
84
  #
87
85
  # @option options [im] :channel
88
86
  # Direct message channel to fetch thread from.
@@ -6,7 +6,7 @@ module Slack
6
6
  module Endpoints
7
7
  module Mpim
8
8
  #
9
- # This method closes a multiparty direct message channel.
9
+ # Closes a multiparty direct message channel.
10
10
  #
11
11
  # @option options [channel] :channel
12
12
  # MPIM to close.
@@ -19,18 +19,16 @@ module Slack
19
19
  end
20
20
 
21
21
  #
22
- # This method returns a portion of messages/events from the specified multiparty direct message channel.
23
- # To read the entire history for a multiparty direct message, call the method with no latest or
24
- # oldest arguments, and then continue paging using the instructions below.
22
+ # Fetches history of messages and events from a multiparty direct message.
25
23
  #
26
24
  # @option options [channel] :channel
27
25
  # Multiparty direct message to fetch history for.
26
+ # @option options [Object] :inclusive
27
+ # Include messages with latest or oldest timestamp in results.
28
28
  # @option options [timestamp] :latest
29
29
  # End of time range of messages to include in results.
30
30
  # @option options [timestamp] :oldest
31
31
  # Start of time range of messages to include in results.
32
- # @option options [Object] :inclusive
33
- # Include messages with latest or oldest timestamp in results.
34
32
  # @option options [Object] :unreads
35
33
  # Include unread_count_display in the output?.
36
34
  # @see https://api.slack.com/methods/mpim.history
@@ -42,7 +40,7 @@ module Slack
42
40
  end
43
41
 
44
42
  #
45
- # This method returns a list of all multiparty direct message channels that the user has.
43
+ # Lists multiparty direct message channels for the calling user.
46
44
  #
47
45
  # @see https://api.slack.com/methods/mpim.list
48
46
  # @see https://github.com/dblock/slack-api-ref/blob/master/methods/mpim/mpim.list.json
@@ -51,7 +49,7 @@ module Slack
51
49
  end
52
50
 
53
51
  #
54
- # This method moves the read cursor in a multiparty direct message channel.
52
+ # Sets the read cursor in a multiparty direct message channel.
55
53
  #
56
54
  # @option options [channel] :channel
57
55
  # multiparty direct message channel to set reading cursor in.
@@ -79,7 +77,7 @@ module Slack
79
77
  end
80
78
 
81
79
  #
82
- # This method returns an entire thread (a message plus all the messages in reply to it).
80
+ # Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.
83
81
  #
84
82
  # @option options [channel] :channel
85
83
  # Multiparty direct message channel to fetch thread from.