slack-ruby-client 0.14.6 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +9 -2
  4. data/.rubocop_todo.yml +52 -12
  5. data/.travis.yml +0 -1
  6. data/CHANGELOG.md +10 -0
  7. data/CONTRIBUTING.md +24 -6
  8. data/Dangerfile +1 -1
  9. data/Gemfile +1 -2
  10. data/README.md +20 -1
  11. data/UPGRADING.md +6 -0
  12. data/bin/commands.rb +5 -0
  13. data/bin/commands/admin_conversations.rb +1 -1
  14. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  15. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  16. data/bin/commands/admin_usergroups.rb +48 -0
  17. data/bin/commands/calls.rb +52 -0
  18. data/bin/commands/calls_participants.rb +25 -0
  19. data/bin/commands/chat.rb +5 -5
  20. data/bin/commands/conversations.rb +0 -1
  21. data/lib/slack-ruby-client.rb +2 -4
  22. data/lib/slack/messages/message.rb +0 -4
  23. data/lib/slack/real_time/concurrency/async.rb +1 -3
  24. data/lib/slack/real_time/concurrency/eventmachine.rb +3 -3
  25. data/lib/slack/real_time/models/base.rb +0 -4
  26. data/lib/slack/real_time/socket.rb +2 -2
  27. data/lib/slack/real_time/stores/base.rb +3 -1
  28. data/lib/slack/version.rb +1 -1
  29. data/lib/slack/web/api/endpoints.rb +11 -0
  30. data/lib/slack/web/api/endpoints/admin_conversations.rb +1 -1
  31. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  32. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  33. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  34. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  35. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  36. data/lib/slack/web/api/endpoints/channels.rb +28 -13
  37. data/lib/slack/web/api/endpoints/chat.rb +12 -12
  38. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +1 -1
  39. data/lib/slack/web/api/endpoints/conversations.rb +15 -17
  40. data/lib/slack/web/api/endpoints/files.rb +2 -2
  41. data/lib/slack/web/api/endpoints/files_remote.rb +1 -1
  42. data/lib/slack/web/api/endpoints/groups.rb +16 -0
  43. data/lib/slack/web/api/endpoints/im.rb +10 -4
  44. data/lib/slack/web/api/endpoints/mpim.rb +10 -4
  45. data/lib/slack/web/api/endpoints/oauth.rb +0 -3
  46. data/lib/slack/web/api/endpoints/pins.rb +3 -3
  47. data/lib/slack/web/api/endpoints/reactions.rb +3 -3
  48. data/lib/slack/web/api/endpoints/stars.rb +2 -2
  49. data/lib/slack/web/api/errors.rb +92 -2
  50. data/lib/slack/web/api/mixins.rb +1 -0
  51. data/lib/slack/web/api/mixins/conversations.id.rb +27 -0
  52. data/lib/slack/web/api/mixins/ids.id.rb +1 -3
  53. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +29 -26
  54. data/lib/slack/web/api/templates/method.erb +4 -1
  55. data/lib/slack/web/faraday/connection.rb +23 -20
  56. data/lib/slack/web/pagination/cursor.rb +2 -2
  57. data/slack-ruby-client.gemspec +5 -5
  58. data/spec/fixtures/slack/web/channels_info.yml +108 -15
  59. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  60. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +32 -0
  61. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  62. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  63. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  64. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +3 -3
  65. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
  66. data/spec/slack/web/api/errors/service_unavailable_spec.rb +2 -2
  67. data/spec/slack/web/api/mixins/conversations_spec.rb +41 -0
  68. data/spec/slack/web/client_spec.rb +26 -0
  69. metadata +49 -30
  70. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  71. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  72. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  73. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  74. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module Calls
9
+ #
10
+ # Registers a new Call.
11
+ #
12
+ # @option options [Object] :external_unique_id
13
+ # An ID supplied by the 3rd-party Call provider. It must be unique across all Calls from that service.
14
+ # @option options [Object] :join_url
15
+ # The URL required for a client to join the Call.
16
+ # @option options [Object] :created_by
17
+ # The valid Slack user ID of the user who created this Call. When this method is called with a user token, the created_by field is optional and defaults to the authed user of the token. Otherwise, the field is required.
18
+ # @option options [Object] :date_start
19
+ # Call start time in UTC UNIX timestamp format.
20
+ # @option options [Object] :desktop_app_join_url
21
+ # When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.
22
+ # @option options [Object] :external_display_id
23
+ # An optional, human-readable ID supplied by the 3rd-party Call provider. If supplied, this ID will be displayed in the Call object.
24
+ # @option options [Object] :title
25
+ # The name of the Call.
26
+ # @option options [Object] :users
27
+ # The list of users to register as participants in the Call. Read more on how to specify users here.
28
+ # @see https://api.slack.com/methods/calls.add
29
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls/calls.add.json
30
+ def calls_add(options = {})
31
+ throw ArgumentError.new('Required arguments :external_unique_id missing') if options[:external_unique_id].nil?
32
+ throw ArgumentError.new('Required arguments :join_url missing') if options[:join_url].nil?
33
+ post('calls.add', options)
34
+ end
35
+
36
+ #
37
+ # Ends a Call.
38
+ #
39
+ # @option options [Object] :id
40
+ # id returned when registering the call using the calls.add method.
41
+ # @option options [Object] :duration
42
+ # Call duration in seconds.
43
+ # @see https://api.slack.com/methods/calls.end
44
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls/calls.end.json
45
+ def calls_end(options = {})
46
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
47
+ post('calls.end', options)
48
+ end
49
+
50
+ #
51
+ # Returns information about a Call.
52
+ #
53
+ # @option options [Object] :id
54
+ # id of the Call returned by the calls.add method.
55
+ # @see https://api.slack.com/methods/calls.info
56
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls/calls.info.json
57
+ def calls_info(options = {})
58
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
59
+ post('calls.info', options)
60
+ end
61
+
62
+ #
63
+ # Updates information about a Call.
64
+ #
65
+ # @option options [Object] :id
66
+ # id returned by the calls.add method.
67
+ # @option options [Object] :desktop_app_join_url
68
+ # When supplied, available Slack clients will attempt to directly launch the 3rd-party Call with this URL.
69
+ # @option options [Object] :join_url
70
+ # The URL required for a client to join the Call.
71
+ # @option options [Object] :title
72
+ # The name of the Call.
73
+ # @see https://api.slack.com/methods/calls.update
74
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls/calls.update.json
75
+ def calls_update(options = {})
76
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
77
+ post('calls.update', options)
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module CallsParticipants
9
+ #
10
+ # Registers new participants added to a Call.
11
+ #
12
+ # @option options [Object] :id
13
+ # id returned by the calls.add method.
14
+ # @option options [Object] :users
15
+ # The list of users to add as participants in the Call. Read more on how to specify users here.
16
+ # @see https://api.slack.com/methods/calls.participants.add
17
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls.participants/calls.participants.add.json
18
+ def calls_participants_add(options = {})
19
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
20
+ throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
21
+ post('calls.participants.add', options)
22
+ end
23
+
24
+ #
25
+ # Registers participants removed from a Call.
26
+ #
27
+ # @option options [Object] :id
28
+ # id returned by the calls.add method.
29
+ # @option options [Object] :users
30
+ # The list of users to remove as participants in the Call. Read more on how to specify users here.
31
+ # @see https://api.slack.com/methods/calls.participants.remove
32
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/calls.participants/calls.participants.remove.json
33
+ def calls_participants_remove(options = {})
34
+ throw ArgumentError.new('Required arguments :id missing') if options[:id].nil?
35
+ throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
36
+ post('calls.participants.remove', options)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -15,7 +15,8 @@ module Slack
15
15
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.archive.json
16
16
  def channels_archive(options = {})
17
17
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
18
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
18
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
19
+ logger.warn('channels.archive: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.archive.')
19
20
  post('channels.archive', options)
20
21
  end
21
22
 
@@ -30,6 +31,7 @@ module Slack
30
31
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.create.json
31
32
  def channels_create(options = {})
32
33
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
34
+ logger.warn('channels.create: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.create.')
33
35
  post('channels.create', options)
34
36
  end
35
37
 
@@ -41,7 +43,7 @@ module Slack
41
43
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/channels/channels.delete.json
42
44
  def channels_delete(options = {})
43
45
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
44
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
46
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
45
47
  logger.warn('The channels.delete method is undocumented.')
46
48
  post('channels.delete', options)
47
49
  end
@@ -63,7 +65,8 @@ module Slack
63
65
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.history.json
64
66
  def channels_history(options = {})
65
67
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
66
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
68
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
69
+ logger.warn('channels.history: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.history.')
67
70
  post('channels.history', options)
68
71
  end
69
72
 
@@ -78,7 +81,8 @@ module Slack
78
81
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.info.json
79
82
  def channels_info(options = {})
80
83
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
81
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
84
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
85
+ logger.warn('channels.info: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.info.')
82
86
  post('channels.info', options)
83
87
  end
84
88
 
@@ -94,8 +98,9 @@ module Slack
94
98
  def channels_invite(options = {})
95
99
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
96
100
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
97
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
101
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
98
102
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
103
+ logger.warn('channels.invite: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.invite.')
99
104
  post('channels.invite', options)
100
105
  end
101
106
 
@@ -110,6 +115,7 @@ module Slack
110
115
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.join.json
111
116
  def channels_join(options = {})
112
117
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
118
+ logger.warn('channels.join: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.join.')
113
119
  post('channels.join', options)
114
120
  end
115
121
 
@@ -125,8 +131,9 @@ module Slack
125
131
  def channels_kick(options = {})
126
132
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
127
133
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
128
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
134
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
129
135
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
136
+ logger.warn('channels.kick: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.kick.')
130
137
  post('channels.kick', options)
131
138
  end
132
139
 
@@ -139,7 +146,8 @@ module Slack
139
146
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.leave.json
140
147
  def channels_leave(options = {})
141
148
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
142
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
149
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
150
+ logger.warn('channels.leave: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.leave.')
143
151
  post('channels.leave', options)
144
152
  end
145
153
 
@@ -157,6 +165,7 @@ module Slack
157
165
  # @see https://api.slack.com/methods/channels.list
158
166
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.list.json
159
167
  def channels_list(options = {})
168
+ logger.warn('channels.list: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.list, users.conversations.')
160
169
  if block_given?
161
170
  Pagination::Cursor.new(self, :channels_list, options).each do |page|
162
171
  yield page
@@ -178,7 +187,8 @@ module Slack
178
187
  def channels_mark(options = {})
179
188
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
180
189
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
181
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
190
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
191
+ logger.warn('channels.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
182
192
  post('channels.mark', options)
183
193
  end
184
194
 
@@ -196,7 +206,8 @@ module Slack
196
206
  def channels_rename(options = {})
197
207
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
198
208
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
199
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
209
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
210
+ logger.warn('channels.rename: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.rename.')
200
211
  post('channels.rename', options)
201
212
  end
202
213
 
@@ -212,7 +223,8 @@ module Slack
212
223
  def channels_replies(options = {})
213
224
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
214
225
  throw ArgumentError.new('Required arguments :thread_ts missing') if options[:thread_ts].nil?
215
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
226
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
227
+ logger.warn('channels.replies: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.replies.')
216
228
  post('channels.replies', options)
217
229
  end
218
230
 
@@ -230,7 +242,8 @@ module Slack
230
242
  def channels_setPurpose(options = {})
231
243
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
232
244
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
233
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
245
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
246
+ logger.warn('channels.setPurpose: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.setPurpose.')
234
247
  post('channels.setPurpose', options)
235
248
  end
236
249
 
@@ -246,7 +259,8 @@ module Slack
246
259
  def channels_setTopic(options = {})
247
260
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
248
261
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
249
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
262
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
263
+ logger.warn('channels.setTopic: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.setTopic.')
250
264
  post('channels.setTopic', options)
251
265
  end
252
266
 
@@ -259,7 +273,8 @@ module Slack
259
273
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.unarchive.json
260
274
  def channels_unarchive(options = {})
261
275
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
262
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
276
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
277
+ logger.warn('channels.unarchive: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.unarchive.')
263
278
  post('channels.unarchive', options)
264
279
  end
265
280
  end
@@ -19,7 +19,7 @@ module Slack
19
19
  def chat_command(options = {})
20
20
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
21
21
  throw ArgumentError.new('Required arguments :command missing') if options[:command].nil?
22
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
22
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
23
23
  logger.warn('The chat.command method is undocumented.')
24
24
  post('chat.command', options)
25
25
  end
@@ -38,7 +38,7 @@ module Slack
38
38
  def chat_delete(options = {})
39
39
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
40
40
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
41
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
41
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
42
42
  post('chat.delete', options)
43
43
  end
44
44
 
@@ -56,7 +56,7 @@ module Slack
56
56
  def chat_deleteScheduledMessage(options = {})
57
57
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
58
58
  throw ArgumentError.new('Required arguments :scheduled_message_id missing') if options[:scheduled_message_id].nil?
59
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
59
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
60
60
  post('chat.deleteScheduledMessage', options)
61
61
  end
62
62
 
@@ -72,7 +72,7 @@ module Slack
72
72
  def chat_getPermalink(options = {})
73
73
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
74
74
  throw ArgumentError.new('Required arguments :message_ts missing') if options[:message_ts].nil?
75
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
75
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
76
76
  post('chat.getPermalink', options)
77
77
  end
78
78
 
@@ -250,7 +250,7 @@ module Slack
250
250
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
251
251
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
252
252
  throw ArgumentError.new('Required arguments :unfurls missing') if options[:unfurls].nil?
253
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
253
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
254
254
  post('chat.unfurl', options)
255
255
  end
256
256
 
@@ -259,27 +259,27 @@ module Slack
259
259
  #
260
260
  # @option options [channel] :channel
261
261
  # Channel containing the message to be updated.
262
- # @option options [Object] :text
263
- # New text for the message, using the default formatting rules. It's not required when presenting attachments.
264
262
  # @option options [timestamp] :ts
265
263
  # Timestamp of the message to be updated.
266
264
  # @option options [Object] :as_user
267
265
  # Pass true to update the message as the authed user. Bot users in this context are considered authed users.
268
266
  # @option options [Object] :attachments
269
- # A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text.
267
+ # A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text. If you don't include this field, the message's previous attachments will be retained. To remove previous attachments, include an empty array for this field.
270
268
  # @option options [Object] :blocks
271
- # A JSON-based array of structured blocks, presented as a URL-encoded string.
269
+ # A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will be retained. To remove previous blocks, include an empty array for this field.
272
270
  # @option options [Object] :link_names
273
- # Find and link channel names and usernames. Defaults to none. See below.
271
+ # Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.
274
272
  # @option options [Object] :parse
275
- # Change how messages are treated. Defaults to client, unlike chat.postMessage. See below.
273
+ # Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.
274
+ # @option options [Object] :text
275
+ # New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments.
276
276
  # @see https://api.slack.com/methods/chat.update
277
277
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
278
278
  def chat_update(options = {})
279
279
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
280
280
  throw ArgumentError.new('Required arguments :text, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
281
281
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
282
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
282
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
283
283
  # attachments must be passed as an encoded JSON string
284
284
  if options.key?(:attachments)
285
285
  attachments = options[:attachments]
@@ -22,7 +22,7 @@ module Slack
22
22
  # @see https://api.slack.com/methods/chat.scheduledMessages.list
23
23
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat.scheduledMessages/chat.scheduledMessages.list.json
24
24
  def chat_scheduledMessages_list(options = {})
25
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
25
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
26
26
  if block_given?
27
27
  Pagination::Cursor.new(self, :chat_scheduledMessages_list, options).each do |page|
28
28
  yield page
@@ -15,7 +15,7 @@ module Slack
15
15
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.archive.json
16
16
  def conversations_archive(options = {})
17
17
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
18
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
18
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
19
19
  post('conversations.archive', options)
20
20
  end
21
21
 
@@ -28,7 +28,7 @@ module Slack
28
28
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.close.json
29
29
  def conversations_close(options = {})
30
30
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
31
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
31
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
32
32
  post('conversations.close', options)
33
33
  end
34
34
 
@@ -39,8 +39,6 @@ module Slack
39
39
  # Name of the public or private channel to create.
40
40
  # @option options [Object] :is_private
41
41
  # Create a private channel instead of a public one.
42
- # @option options [Object] :user_ids
43
- # Required for workspace apps. A list of between 1 and 30 human users that will be added to the newly-created conversation. This argument has no effect when used by classic Slack apps.
44
42
  # @see https://api.slack.com/methods/conversations.create
45
43
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
46
44
  def conversations_create(options = {})
@@ -67,7 +65,7 @@ module Slack
67
65
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.history.json
68
66
  def conversations_history(options = {})
69
67
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
70
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
68
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
71
69
  if block_given?
72
70
  Pagination::Cursor.new(self, :conversations_history, options).each do |page|
73
71
  yield page
@@ -90,7 +88,7 @@ module Slack
90
88
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.info.json
91
89
  def conversations_info(options = {})
92
90
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
93
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
91
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
94
92
  post('conversations.info', options)
95
93
  end
96
94
 
@@ -106,7 +104,7 @@ module Slack
106
104
  def conversations_invite(options = {})
107
105
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
108
106
  throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
109
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
107
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
110
108
  post('conversations.invite', options)
111
109
  end
112
110
 
@@ -119,7 +117,7 @@ module Slack
119
117
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.join.json
120
118
  def conversations_join(options = {})
121
119
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
122
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
120
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
123
121
  post('conversations.join', options)
124
122
  end
125
123
 
@@ -135,7 +133,7 @@ module Slack
135
133
  def conversations_kick(options = {})
136
134
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
137
135
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
138
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
136
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
139
137
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
140
138
  post('conversations.kick', options)
141
139
  end
@@ -149,7 +147,7 @@ module Slack
149
147
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
150
148
  def conversations_leave(options = {})
151
149
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
152
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
150
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
153
151
  post('conversations.leave', options)
154
152
  end
155
153
 
@@ -189,7 +187,7 @@ module Slack
189
187
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.members.json
190
188
  def conversations_members(options = {})
191
189
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
192
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
190
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
193
191
  if block_given?
194
192
  Pagination::Cursor.new(self, :conversations_members, options).each do |page|
195
193
  yield page
@@ -211,7 +209,7 @@ module Slack
211
209
  # @see https://api.slack.com/methods/conversations.open
212
210
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.open.json
213
211
  def conversations_open(options = {})
214
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
212
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
215
213
  post('conversations.open', options)
216
214
  end
217
215
 
@@ -227,7 +225,7 @@ module Slack
227
225
  def conversations_rename(options = {})
228
226
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
229
227
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
230
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
228
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
231
229
  post('conversations.rename', options)
232
230
  end
233
231
 
@@ -253,7 +251,7 @@ module Slack
253
251
  def conversations_replies(options = {})
254
252
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
255
253
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
256
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
254
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
257
255
  if block_given?
258
256
  Pagination::Cursor.new(self, :conversations_replies, options).each do |page|
259
257
  yield page
@@ -275,7 +273,7 @@ module Slack
275
273
  def conversations_setPurpose(options = {})
276
274
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
277
275
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
278
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
276
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
279
277
  post('conversations.setPurpose', options)
280
278
  end
281
279
 
@@ -291,7 +289,7 @@ module Slack
291
289
  def conversations_setTopic(options = {})
292
290
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
293
291
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
294
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
292
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
295
293
  post('conversations.setTopic', options)
296
294
  end
297
295
 
@@ -304,7 +302,7 @@ module Slack
304
302
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
305
303
  def conversations_unarchive(options = {})
306
304
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
307
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
305
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
308
306
  post('conversations.unarchive', options)
309
307
  end
310
308
  end