slack-ruby-client 0.14.3 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (326) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +23 -7
  4. data/.rubocop_todo.yml +115 -44
  5. data/.travis.yml +0 -1
  6. data/CHANGELOG.md +38 -2
  7. data/CONTRIBUTING.md +24 -6
  8. data/Dangerfile +2 -1
  9. data/Gemfile +2 -2
  10. data/README.md +90 -29
  11. data/Rakefile +1 -0
  12. data/UPGRADING.md +6 -0
  13. data/bin/commands.rb +23 -0
  14. data/bin/commands/admin_apps.rb +27 -0
  15. data/bin/commands/admin_apps_approved.rb +17 -0
  16. data/bin/commands/admin_apps_requests.rb +16 -0
  17. data/bin/commands/admin_apps_restricted.rb +17 -0
  18. data/bin/commands/admin_conversations.rb +17 -0
  19. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  20. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  21. data/bin/commands/admin_emoji.rb +54 -0
  22. data/bin/commands/admin_inviteRequests.rb +36 -0
  23. data/bin/commands/admin_inviteRequests_approved.rb +16 -0
  24. data/bin/commands/admin_inviteRequests_denied.rb +16 -0
  25. data/bin/commands/admin_teams.rb +27 -0
  26. data/bin/commands/admin_teams_admins.rb +16 -0
  27. data/bin/commands/admin_teams_owners.rb +16 -0
  28. data/bin/commands/admin_teams_settings.rb +64 -0
  29. data/bin/commands/admin_usergroups.rb +48 -0
  30. data/bin/commands/admin_users.rb +97 -0
  31. data/bin/commands/admin_users_session.rb +3 -2
  32. data/bin/commands/api.rb +3 -2
  33. data/bin/commands/apps.rb +3 -2
  34. data/bin/commands/apps_permissions.rb +5 -4
  35. data/bin/commands/apps_permissions_resources.rb +3 -2
  36. data/bin/commands/apps_permissions_scopes.rb +3 -2
  37. data/bin/commands/apps_permissions_users.rb +5 -4
  38. data/bin/commands/auth.rb +5 -4
  39. data/bin/commands/bots.rb +3 -2
  40. data/bin/commands/calls.rb +52 -0
  41. data/bin/commands/calls_participants.rb +25 -0
  42. data/bin/commands/channels.rb +31 -30
  43. data/bin/commands/chat.rb +32 -31
  44. data/bin/commands/chat_scheduledMessages.rb +3 -2
  45. data/bin/commands/conversations.rb +36 -36
  46. data/bin/commands/dialog.rb +3 -2
  47. data/bin/commands/dnd.rb +9 -8
  48. data/bin/commands/emoji.rb +3 -2
  49. data/bin/commands/files.rb +14 -12
  50. data/bin/commands/files_comments.rb +3 -2
  51. data/bin/commands/files_remote.rb +78 -0
  52. data/bin/commands/groups.rb +33 -32
  53. data/bin/commands/im.rb +13 -12
  54. data/bin/commands/migration.rb +3 -2
  55. data/bin/commands/mpim.rb +11 -10
  56. data/bin/commands/oauth.rb +6 -5
  57. data/bin/commands/oauth_v2.rb +17 -0
  58. data/bin/commands/pins.rb +7 -8
  59. data/bin/commands/reactions.rb +10 -11
  60. data/bin/commands/reminders.rb +11 -10
  61. data/bin/commands/rtm.rb +5 -4
  62. data/bin/commands/search.rb +7 -6
  63. data/bin/commands/stars.rb +7 -6
  64. data/bin/commands/team.rb +9 -8
  65. data/bin/commands/team_profile.rb +3 -2
  66. data/bin/commands/usergroups.rb +11 -10
  67. data/bin/commands/usergroups_users.rb +5 -4
  68. data/bin/commands/users.rb +21 -20
  69. data/bin/commands/users_admin.rb +1 -0
  70. data/bin/commands/users_prefs.rb +1 -0
  71. data/bin/commands/users_profile.rb +5 -4
  72. data/bin/commands/views.rb +48 -0
  73. data/bin/slack +1 -2
  74. data/examples/hi_real_time/Gemfile +1 -0
  75. data/examples/hi_real_time/hi.rb +7 -3
  76. data/examples/hi_real_time_and_web/Gemfile +1 -0
  77. data/examples/hi_real_time_and_web/hi.rb +7 -3
  78. data/examples/hi_real_time_async_async/Gemfile +1 -0
  79. data/examples/hi_real_time_async_async/hi.rb +6 -2
  80. data/examples/hi_real_time_async_celluloid/Gemfile +1 -0
  81. data/examples/hi_real_time_async_celluloid/hi.rb +7 -3
  82. data/examples/hi_real_time_async_eventmachine/Gemfile +1 -0
  83. data/examples/hi_real_time_async_eventmachine/hi.rb +7 -3
  84. data/examples/hi_web/Gemfile +1 -0
  85. data/examples/hi_web/hi.rb +1 -0
  86. data/examples/new_ticket/Gemfile +1 -0
  87. data/examples/new_ticket/new_ticket.rb +1 -0
  88. data/lib/slack-ruby-client.rb +4 -4
  89. data/lib/slack.rb +1 -0
  90. data/lib/slack/config.rb +1 -0
  91. data/lib/slack/events/config.rb +1 -0
  92. data/lib/slack/events/request.rb +3 -1
  93. data/lib/slack/logger.rb +6 -5
  94. data/lib/slack/messages/formatting.rb +1 -0
  95. data/lib/slack/messages/message.rb +1 -4
  96. data/lib/slack/real_time/api/message.rb +3 -1
  97. data/lib/slack/real_time/api/message_id.rb +1 -0
  98. data/lib/slack/real_time/api/ping.rb +5 -2
  99. data/lib/slack/real_time/api/typing.rb +3 -1
  100. data/lib/slack/real_time/client.rb +26 -13
  101. data/lib/slack/real_time/concurrency.rb +1 -0
  102. data/lib/slack/real_time/concurrency/async.rb +13 -7
  103. data/lib/slack/real_time/concurrency/celluloid.rb +10 -4
  104. data/lib/slack/real_time/concurrency/eventmachine.rb +9 -6
  105. data/lib/slack/real_time/config.rb +6 -1
  106. data/lib/slack/real_time/models.rb +1 -0
  107. data/lib/slack/real_time/models/base.rb +1 -4
  108. data/lib/slack/real_time/models/bot.rb +1 -0
  109. data/lib/slack/real_time/models/channel.rb +1 -0
  110. data/lib/slack/real_time/models/group.rb +1 -0
  111. data/lib/slack/real_time/models/im.rb +1 -0
  112. data/lib/slack/real_time/models/team.rb +1 -0
  113. data/lib/slack/real_time/models/user.rb +1 -0
  114. data/lib/slack/real_time/socket.rb +16 -13
  115. data/lib/slack/real_time/stores.rb +1 -0
  116. data/lib/slack/real_time/stores/base.rb +4 -1
  117. data/lib/slack/real_time/stores/starter.rb +1 -0
  118. data/lib/slack/real_time/stores/store.rb +16 -25
  119. data/lib/slack/version.rb +2 -1
  120. data/lib/slack/web/api/endpoints.rb +46 -0
  121. data/lib/slack/web/api/endpoints/admin_apps.rb +42 -0
  122. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
  123. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +33 -0
  124. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
  125. data/lib/slack/web/api/endpoints/admin_conversations.rb +30 -0
  126. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  127. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  128. data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
  129. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
  130. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
  131. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
  132. data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
  133. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
  134. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
  135. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
  136. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  137. data/lib/slack/web/api/endpoints/admin_users.rb +163 -0
  138. data/lib/slack/web/api/endpoints/admin_users_session.rb +2 -1
  139. data/lib/slack/web/api/endpoints/api.rb +2 -1
  140. data/lib/slack/web/api/endpoints/apps.rb +2 -1
  141. data/lib/slack/web/api/endpoints/apps_permissions.rb +3 -2
  142. data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +2 -1
  143. data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +2 -1
  144. data/lib/slack/web/api/endpoints/apps_permissions_users.rb +3 -2
  145. data/lib/slack/web/api/endpoints/auth.rb +3 -2
  146. data/lib/slack/web/api/endpoints/bots.rb +2 -1
  147. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  148. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  149. data/lib/slack/web/api/endpoints/channels.rb +44 -29
  150. data/lib/slack/web/api/endpoints/chat.rb +30 -29
  151. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -2
  152. data/lib/slack/web/api/endpoints/conversations.rb +34 -35
  153. data/lib/slack/web/api/endpoints/dialog.rb +2 -1
  154. data/lib/slack/web/api/endpoints/dnd.rb +5 -4
  155. data/lib/slack/web/api/endpoints/emoji.rb +2 -1
  156. data/lib/slack/web/api/endpoints/files.rb +11 -8
  157. data/lib/slack/web/api/endpoints/files_comments.rb +2 -1
  158. data/lib/slack/web/api/endpoints/files_remote.rb +127 -0
  159. data/lib/slack/web/api/endpoints/groups.rb +33 -22
  160. data/lib/slack/web/api/endpoints/im.rb +17 -12
  161. data/lib/slack/web/api/endpoints/migration.rb +2 -1
  162. data/lib/slack/web/api/endpoints/mpim.rb +16 -11
  163. data/lib/slack/web/api/endpoints/oauth.rb +4 -6
  164. data/lib/slack/web/api/endpoints/oauth_v2.rb +30 -0
  165. data/lib/slack/web/api/endpoints/pins.rb +8 -12
  166. data/lib/slack/web/api/endpoints/reactions.rb +12 -15
  167. data/lib/slack/web/api/endpoints/reminders.rb +6 -5
  168. data/lib/slack/web/api/endpoints/rtm.rb +3 -2
  169. data/lib/slack/web/api/endpoints/search.rb +4 -3
  170. data/lib/slack/web/api/endpoints/stars.rb +6 -7
  171. data/lib/slack/web/api/endpoints/team.rb +5 -5
  172. data/lib/slack/web/api/endpoints/team_profile.rb +2 -1
  173. data/lib/slack/web/api/endpoints/usergroups.rb +6 -5
  174. data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -2
  175. data/lib/slack/web/api/endpoints/users.rb +11 -16
  176. data/lib/slack/web/api/endpoints/users_admin.rb +1 -0
  177. data/lib/slack/web/api/endpoints/users_prefs.rb +1 -0
  178. data/lib/slack/web/api/endpoints/users_profile.rb +3 -2
  179. data/lib/slack/web/api/endpoints/views.rb +97 -0
  180. data/lib/slack/web/api/error.rb +1 -0
  181. data/lib/slack/web/api/errors.rb +656 -0
  182. data/lib/slack/web/api/errors/slack_error.rb +14 -1
  183. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -0
  184. data/lib/slack/web/api/mixins.rb +2 -0
  185. data/lib/slack/web/api/mixins/channels.id.rb +2 -3
  186. data/lib/slack/web/api/mixins/conversations.id.rb +25 -0
  187. data/lib/slack/web/api/mixins/groups.id.rb +2 -3
  188. data/lib/slack/web/api/mixins/ids.id.rb +3 -2
  189. data/lib/slack/web/api/mixins/users.id.rb +2 -3
  190. data/lib/slack/web/api/mixins/users.search.rb +1 -0
  191. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +29 -26
  192. data/lib/slack/web/api/patches/views.1.view-json.patch +40 -0
  193. data/lib/slack/web/api/patches/views.1.views-published.patch +16 -0
  194. data/lib/slack/web/api/templates/command.erb +1 -0
  195. data/lib/slack/web/api/templates/commands.erb +1 -0
  196. data/lib/slack/web/api/templates/endpoints.erb +1 -0
  197. data/lib/slack/web/api/templates/errors.erb +20 -0
  198. data/lib/slack/web/api/templates/method.erb +5 -1
  199. data/lib/slack/web/api/templates/method_spec.erb +1 -0
  200. data/lib/slack/web/client.rb +2 -1
  201. data/lib/slack/web/config.rb +3 -0
  202. data/lib/slack/web/faraday/connection.rb +24 -20
  203. data/lib/slack/web/faraday/request.rb +1 -0
  204. data/lib/slack/web/faraday/response/raise_error.rb +10 -6
  205. data/lib/slack/web/pagination/cursor.rb +3 -2
  206. data/lib/slack_ruby_client.rb +1 -0
  207. data/lib/tasks/git.rake +1 -0
  208. data/lib/tasks/real_time.rake +13 -5
  209. data/lib/tasks/update.rake +1 -0
  210. data/lib/tasks/web.rake +27 -7
  211. data/screenshots/create-app.png +0 -0
  212. data/slack-ruby-client.gemspec +6 -3
  213. data/spec/fixtures/slack/web/channels_info.yml +108 -15
  214. data/spec/fixtures/slack/web/conversations_setTopic.yml +69 -0
  215. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +142 -0
  216. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +208 -0
  217. data/spec/fixtures/slack/web/views_open_error.yml +76 -0
  218. data/spec/integration/integration_spec.rb +26 -23
  219. data/spec/slack/config_spec.rb +2 -0
  220. data/spec/slack/events/config_spec.rb +8 -4
  221. data/spec/slack/events/request_spec.rb +67 -37
  222. data/spec/slack/messages/formatting_spec.rb +25 -13
  223. data/spec/slack/real_time/api/message_spec.rb +6 -1
  224. data/spec/slack/real_time/api/ping_spec.rb +2 -0
  225. data/spec/slack/real_time/api/typing_spec.rb +5 -1
  226. data/spec/slack/real_time/client_spec.rb +174 -36
  227. data/spec/slack/real_time/concurrency/celluloid_spec.rb +11 -6
  228. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +9 -1
  229. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +2 -0
  230. data/spec/slack/real_time/event_handlers/bot_spec.rb +2 -1
  231. data/spec/slack/real_time/event_handlers/channel_spec.rb +9 -6
  232. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +2 -1
  233. data/spec/slack/real_time/event_handlers/group_spec.rb +5 -4
  234. data/spec/slack/real_time/event_handlers/im_spec.rb +4 -3
  235. data/spec/slack/real_time/event_handlers/team_spec.rb +3 -1
  236. data/spec/slack/real_time/event_handlers/user_spec.rb +1 -0
  237. data/spec/slack/real_time/rtm_connect_spec.rb +1 -0
  238. data/spec/slack/real_time/rtm_start_spec.rb +1 -0
  239. data/spec/slack/real_time/store_spec.rb +2 -1
  240. data/spec/slack/slack_spec.rb +37 -5
  241. data/spec/slack/version_spec.rb +2 -1
  242. data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
  243. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +8 -0
  244. data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
  245. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +8 -0
  246. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  247. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +13 -0
  248. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +32 -0
  249. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
  250. data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
  251. data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
  252. data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
  253. data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
  254. data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
  255. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
  256. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
  257. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  258. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +1 -0
  259. data/spec/slack/web/api/endpoints/admin_users_spec.rb +75 -0
  260. data/spec/slack/web/api/endpoints/api_spec.rb +1 -0
  261. data/spec/slack/web/api/endpoints/apps_permissions_resources_spec.rb +1 -0
  262. data/spec/slack/web/api/endpoints/apps_permissions_scopes_spec.rb +1 -0
  263. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +3 -2
  264. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +4 -3
  265. data/spec/slack/web/api/endpoints/apps_spec.rb +1 -0
  266. data/spec/slack/web/api/endpoints/bots_spec.rb +1 -0
  267. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  268. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  269. data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +1 -0
  270. data/spec/slack/web/api/endpoints/conversations_spec.rb +2 -1
  271. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +5 -1
  272. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +5 -3
  273. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +80 -25
  274. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +12 -4
  275. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +2 -0
  276. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +6 -1
  277. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +95 -0
  278. data/spec/slack/web/api/endpoints/dnd_spec.rb +1 -0
  279. data/spec/slack/web/api/endpoints/emoji_spec.rb +1 -0
  280. data/spec/slack/web/api/endpoints/files_comments_spec.rb +1 -0
  281. data/spec/slack/web/api/endpoints/files_remote_spec.rb +24 -0
  282. data/spec/slack/web/api/endpoints/files_spec.rb +1 -0
  283. data/spec/slack/web/api/endpoints/im_spec.rb +1 -0
  284. data/spec/slack/web/api/endpoints/migration_spec.rb +1 -0
  285. data/spec/slack/web/api/endpoints/mpim_spec.rb +1 -0
  286. data/spec/slack/web/api/endpoints/oauth_spec.rb +1 -11
  287. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +13 -0
  288. data/spec/slack/web/api/endpoints/pins_spec.rb +5 -1
  289. data/spec/slack/web/api/endpoints/reactions_spec.rb +8 -1
  290. data/spec/slack/web/api/endpoints/reminders_spec.rb +1 -0
  291. data/spec/slack/web/api/endpoints/rtm_spec.rb +1 -0
  292. data/spec/slack/web/api/endpoints/search_spec.rb +1 -0
  293. data/spec/slack/web/api/endpoints/stars_spec.rb +1 -0
  294. data/spec/slack/web/api/endpoints/team_profile_spec.rb +1 -0
  295. data/spec/slack/web/api/endpoints/team_spec.rb +1 -0
  296. data/spec/slack/web/api/endpoints/usergroups_spec.rb +1 -0
  297. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +1 -0
  298. data/spec/slack/web/api/endpoints/users_admin_spec.rb +1 -0
  299. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +1 -0
  300. data/spec/slack/web/api/endpoints/users_profile_spec.rb +1 -0
  301. data/spec/slack/web/api/endpoints/views_spec.rb +29 -0
  302. data/spec/slack/web/api/error_spec.rb +4 -2
  303. data/spec/slack/web/api/errors/service_unavailable_spec.rb +8 -5
  304. data/spec/slack/web/api/errors/slack_error_spec.rb +26 -2
  305. data/spec/slack/web/api/mixins/channels_spec.rb +17 -7
  306. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  307. data/spec/slack/web/api/mixins/conversations_spec.rb +43 -0
  308. data/spec/slack/web/api/mixins/groups_spec.rb +17 -7
  309. data/spec/slack/web/api/mixins/users_spec.rb +17 -8
  310. data/spec/slack/web/api/pagination/cursor_spec.rb +40 -10
  311. data/spec/slack/web/client_spec.rb +115 -18
  312. data/spec/slack/web/faraday/response/raise_error_spec.rb +41 -7
  313. data/spec/spec_helper.rb +2 -1
  314. data/spec/support/queue_with_timeout.rb +1 -0
  315. data/spec/support/real_time/concurrency/mock.rb +1 -0
  316. data/spec/support/real_time/connected_client.rb +9 -3
  317. data/spec/support/real_time/event.rb +1 -0
  318. data/spec/support/token.rb +1 -0
  319. data/spec/support/vcr.rb +5 -0
  320. metadata +160 -29
  321. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  322. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  323. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  324. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  325. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
  326. data/screenshots/register-bot.png +0 -0
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -18,13 +19,13 @@ module Slack
18
19
  def chat_command(options = {})
19
20
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
20
21
  throw ArgumentError.new('Required arguments :command missing') if options[:command].nil?
21
- 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]
22
23
  logger.warn('The chat.command method is undocumented.')
23
24
  post('chat.command', options)
24
25
  end
25
26
 
26
27
  #
27
- # This method deletes a message from a channel.
28
+ # Deletes a message.
28
29
  #
29
30
  # @option options [channel] :channel
30
31
  # Channel containing the message to be deleted.
@@ -37,12 +38,12 @@ module Slack
37
38
  def chat_delete(options = {})
38
39
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
39
40
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
40
- 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]
41
42
  post('chat.delete', options)
42
43
  end
43
44
 
44
45
  #
45
- # This method deletes a pending scheduled message before it is sent.
46
+ # Deletes a pending scheduled message from the queue.
46
47
  #
47
48
  # @option options [channel] :channel
48
49
  # The channel the scheduled_message is posting to.
@@ -55,12 +56,12 @@ module Slack
55
56
  def chat_deleteScheduledMessage(options = {})
56
57
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
57
58
  throw ArgumentError.new('Required arguments :scheduled_message_id missing') if options[:scheduled_message_id].nil?
58
- 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]
59
60
  post('chat.deleteScheduledMessage', options)
60
61
  end
61
62
 
62
63
  #
63
- # Easily exchange a message timestamp and a channel ID for a friendly HTTP-based permalink to that message. Handles message threads and all conversation types.
64
+ # Retrieve a permalink URL for a specific extant message
64
65
  #
65
66
  # @option options [channel] :channel
66
67
  # The ID of the conversation or channel containing the message.
@@ -71,12 +72,12 @@ module Slack
71
72
  def chat_getPermalink(options = {})
72
73
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
73
74
  throw ArgumentError.new('Required arguments :message_ts missing') if options[:message_ts].nil?
74
- 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]
75
76
  post('chat.getPermalink', options)
76
77
  end
77
78
 
78
79
  #
79
- # This method sends a me message to a channel from the calling user.
80
+ # Share a me message into a channel.
80
81
  #
81
82
  # @option options [channel] :channel
82
83
  # Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.
@@ -91,14 +92,14 @@ module Slack
91
92
  end
92
93
 
93
94
  #
94
- # This method posts an ephemeral message, which is visible only to the assigned user in a specific public channel, private channel, or private conversation.
95
+ # Sends an ephemeral message to a user in a channel.
95
96
  #
96
97
  # @option options [Object] :attachments
97
98
  # A JSON-based array of structured attachments, presented as a URL-encoded string.
98
99
  # @option options [channel] :channel
99
100
  # Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
100
101
  # @option options [Object] :text
101
- # Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead.
102
+ # How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
102
103
  # @option options [user] :user
103
104
  # id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.
104
105
  # @option options [Object] :as_user
@@ -140,22 +141,22 @@ module Slack
140
141
  end
141
142
 
142
143
  #
143
- # This method posts a message to a public channel, private channel, or direct message/IM channel.
144
+ # Sends a message to a channel.
144
145
  #
145
146
  # @option options [channel] :channel
146
147
  # Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.
147
148
  # @option options [Object] :text
148
- # Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead. Provide no more than 40,000 characters or risk truncation.
149
+ # How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
149
150
  # @option options [Object] :as_user
150
- # Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.
151
+ # Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below. This argument may not be used with newer bot tokens.
151
152
  # @option options [Object] :attachments
152
153
  # A JSON-based array of structured attachments, presented as a URL-encoded string.
153
154
  # @option options [Object] :blocks
154
155
  # A JSON-based array of structured blocks, presented as a URL-encoded string.
155
156
  # @option options [Object] :icon_emoji
156
- # 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.
157
+ # 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. This argument may not be used with newer bot tokens.
157
158
  # @option options [Object] :icon_url
158
- # 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.
159
+ # 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. This argument may not be used with newer bot tokens.
159
160
  # @option options [Object] :link_names
160
161
  # Find and link channel names and usernames.
161
162
  # @option options [Object] :mrkdwn
@@ -193,16 +194,16 @@ module Slack
193
194
  end
194
195
 
195
196
  #
196
- # This method schedules a message for delivery to a public channel, private channel, or direct message/IM channel at a specified time in the future.
197
+ # Schedules a message to be sent to a channel.
197
198
  #
198
199
  # @option options [channel] :channel
199
200
  # Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.
200
201
  # @option options [Object] :post_at
201
202
  # Unix EPOCH timestamp of time in future to send the message.
202
203
  # @option options [Object] :text
203
- # Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead. Provide no more than 40,000 characters or risk truncation.
204
+ # How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
204
205
  # @option options [Object] :as_user
205
- # Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.
206
+ # Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See chat.postMessage.
206
207
  # @option options [Object] :attachments
207
208
  # A JSON-based array of structured attachments, presented as a URL-encoded string.
208
209
  # @option options [Object] :blocks
@@ -210,7 +211,7 @@ module Slack
210
211
  # @option options [Object] :link_names
211
212
  # Find and link channel names and usernames.
212
213
  # @option options [Object] :parse
213
- # Change how messages are treated. Defaults to none. See below.
214
+ # Change how messages are treated. Defaults to none. See chat.postMessage.
214
215
  # @option options [Object] :reply_broadcast
215
216
  # Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.
216
217
  # @option options [Object] :thread_ts
@@ -229,7 +230,7 @@ module Slack
229
230
  end
230
231
 
231
232
  #
232
- # This method attaches Slack app unfurl behavior to a specified and relevant message. A user token is required as this method does not support bot user tokens.
233
+ # Provide custom unfurl behavior for user-posted URLs
233
234
  #
234
235
  # @option options [channel] :channel
235
236
  # Channel ID of the message.
@@ -249,36 +250,36 @@ module Slack
249
250
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
250
251
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
251
252
  throw ArgumentError.new('Required arguments :unfurls missing') if options[:unfurls].nil?
252
- 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]
253
254
  post('chat.unfurl', options)
254
255
  end
255
256
 
256
257
  #
257
- # This method updates a message in a channel. Though related to chat.postMessage, some parameters of chat.update are handled differently.
258
+ # Updates a message.
258
259
  #
259
260
  # @option options [channel] :channel
260
261
  # Channel containing the message to be updated.
261
- # @option options [Object] :text
262
- # New text for the message, using the default formatting rules. It's not required when presenting attachments.
263
262
  # @option options [timestamp] :ts
264
263
  # Timestamp of the message to be updated.
265
264
  # @option options [Object] :as_user
266
265
  # Pass true to update the message as the authed user. Bot users in this context are considered authed users.
267
266
  # @option options [Object] :attachments
268
- # 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.
269
268
  # @option options [Object] :blocks
270
- # 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.
271
270
  # @option options [Object] :link_names
272
- # 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.
273
272
  # @option options [Object] :parse
274
- # 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.
275
276
  # @see https://api.slack.com/methods/chat.update
276
277
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
277
278
  def chat_update(options = {})
278
279
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
279
280
  throw ArgumentError.new('Required arguments :text, :attachments or :blocks missing') if options[:text].nil? && options[:attachments].nil? && options[:blocks].nil?
280
281
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
281
- 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]
282
283
  # attachments must be passed as an encoded JSON string
283
284
  if options.key?(:attachments)
284
285
  attachments = options[:attachments]
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -6,7 +7,7 @@ module Slack
6
7
  module Endpoints
7
8
  module ChatScheduledmessages
8
9
  #
9
- # This method returns a list of pending scheduled messages.
10
+ # Returns a list of scheduled messages.
10
11
  #
11
12
  # @option options [channel] :channel
12
13
  # The channel of the scheduled messages.
@@ -21,7 +22,7 @@ module Slack
21
22
  # @see https://api.slack.com/methods/chat.scheduledMessages.list
22
23
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat.scheduledMessages/chat.scheduledMessages.list.json
23
24
  def chat_scheduledMessages_list(options = {})
24
- 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]
25
26
  if block_given?
26
27
  Pagination::Cursor.new(self, :chat_scheduledMessages_list, options).each do |page|
27
28
  yield page
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # This file was auto-generated by lib/tasks/web.rake
2
3
 
3
4
  module Slack
@@ -6,7 +7,7 @@ module Slack
6
7
  module Endpoints
7
8
  module Conversations
8
9
  #
9
- # This method archives a conversation. Not all types of conversations can be archived.
10
+ # Archives a conversation.
10
11
  #
11
12
  # @option options [channel] :channel
12
13
  # ID of conversation to archive.
@@ -14,12 +15,12 @@ module Slack
14
15
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.archive.json
15
16
  def conversations_archive(options = {})
16
17
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
17
- 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]
18
19
  post('conversations.archive', options)
19
20
  end
20
21
 
21
22
  #
22
- # This Conversations API method closes direct messages, multi-person or 1:1 or otherwise.
23
+ # Closes a direct message or multi-person direct message.
23
24
  #
24
25
  # @option options [channel] :channel
25
26
  # Conversation to close.
@@ -27,19 +28,17 @@ module Slack
27
28
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.close.json
28
29
  def conversations_close(options = {})
29
30
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
30
- 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]
31
32
  post('conversations.close', options)
32
33
  end
33
34
 
34
35
  #
35
- # Create a public or private channel using this Conversations API method.
36
+ # Initiates a public or private channel-based conversation
36
37
  #
37
38
  # @option options [Object] :name
38
39
  # Name of the public or private channel to create.
39
40
  # @option options [Object] :is_private
40
41
  # Create a private channel instead of a public one.
41
- # @option options [Object] :user_ids
42
- # 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.
43
42
  # @see https://api.slack.com/methods/conversations.create
44
43
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
45
44
  def conversations_create(options = {})
@@ -48,7 +47,7 @@ module Slack
48
47
  end
49
48
 
50
49
  #
51
- # This method returns a portion of message events from the specified conversation.
50
+ # Fetches a conversation's history of messages and events.
52
51
  #
53
52
  # @option options [channel] :channel
54
53
  # Conversation ID to fetch history for.
@@ -66,7 +65,7 @@ module Slack
66
65
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.history.json
67
66
  def conversations_history(options = {})
68
67
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
69
- 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]
70
69
  if block_given?
71
70
  Pagination::Cursor.new(self, :conversations_history, options).each do |page|
72
71
  yield page
@@ -77,7 +76,7 @@ module Slack
77
76
  end
78
77
 
79
78
  #
80
- # This Conversations API method returns information about a workspace conversation.
79
+ # Retrieve information about a conversation.
81
80
  #
82
81
  # @option options [channel] :channel
83
82
  # Conversation ID to learn more about.
@@ -89,28 +88,28 @@ module Slack
89
88
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.info.json
90
89
  def conversations_info(options = {})
91
90
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
92
- 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]
93
92
  post('conversations.info', options)
94
93
  end
95
94
 
96
95
  #
97
- # This Conversations API method invites 1-30 users to a public or private channel. The calling user must be a member of the channel.
96
+ # Invites users to a channel.
98
97
  #
99
98
  # @option options [channel] :channel
100
99
  # The ID of the public or private channel to invite user(s) to.
101
100
  # @option options [Object] :users
102
- # A comma separated list of user IDs. Up to 30 users may be listed.
101
+ # A comma separated list of user IDs. Up to 1000 users may be listed.
103
102
  # @see https://api.slack.com/methods/conversations.invite
104
103
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
105
104
  def conversations_invite(options = {})
106
105
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
107
106
  throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
108
- 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]
109
108
  post('conversations.invite', options)
110
109
  end
111
110
 
112
111
  #
113
- # This Conversations API method joins a user to an existing conversation.
112
+ # Joins an existing conversation.
114
113
  #
115
114
  # @option options [channel] :channel
116
115
  # ID of conversation to join.
@@ -118,12 +117,12 @@ module Slack
118
117
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.join.json
119
118
  def conversations_join(options = {})
120
119
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
121
- 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]
122
121
  post('conversations.join', options)
123
122
  end
124
123
 
125
124
  #
126
- # This Conversations API method allows a user to remove another member from a channel.
125
+ # Removes a user from a conversation.
127
126
  #
128
127
  # @option options [channel] :channel
129
128
  # ID of conversation to remove user from.
@@ -134,13 +133,13 @@ module Slack
134
133
  def conversations_kick(options = {})
135
134
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
136
135
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
137
- 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]
138
137
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
139
138
  post('conversations.kick', options)
140
139
  end
141
140
 
142
141
  #
143
- # This Conversations API method makes like a tree and leaves a conversation.
142
+ # Leaves a conversation.
144
143
  #
145
144
  # @option options [channel] :channel
146
145
  # Conversation to leave.
@@ -148,12 +147,12 @@ module Slack
148
147
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
149
148
  def conversations_leave(options = {})
150
149
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
151
- 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]
152
151
  post('conversations.leave', options)
153
152
  end
154
153
 
155
154
  #
156
- # This Conversations API method returns a list of all channel-like conversations in a workspace. The "channels" returned depend on what the calling token has access to and the directives placed in the types parameter.
155
+ # Lists all channels in a Slack team.
157
156
  #
158
157
  # @option options [Object] :cursor
159
158
  # Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
@@ -176,7 +175,7 @@ module Slack
176
175
  end
177
176
 
178
177
  #
179
- # This Conversations API method returns a paginated list of members party to a conversation.
178
+ # Retrieve members of a conversation.
180
179
  #
181
180
  # @option options [channel] :channel
182
181
  # ID of the conversation to retrieve members for.
@@ -188,7 +187,7 @@ module Slack
188
187
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.members.json
189
188
  def conversations_members(options = {})
190
189
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
191
- 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]
192
191
  if block_given?
193
192
  Pagination::Cursor.new(self, :conversations_members, options).each do |page|
194
193
  yield page
@@ -199,7 +198,7 @@ module Slack
199
198
  end
200
199
 
201
200
  #
202
- # This Conversations API method opens a multi-person direct message or just a 1:1 direct message.
201
+ # Opens or resumes a direct message or multi-person direct message.
203
202
  #
204
203
  # @option options [channel] :channel
205
204
  # Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead.
@@ -210,12 +209,12 @@ module Slack
210
209
  # @see https://api.slack.com/methods/conversations.open
211
210
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.open.json
212
211
  def conversations_open(options = {})
213
- 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]
214
213
  post('conversations.open', options)
215
214
  end
216
215
 
217
216
  #
218
- # This method renames a conversation. Some types of conversations cannot be renamed.
217
+ # Renames a conversation.
219
218
  #
220
219
  # @option options [channel] :channel
221
220
  # ID of conversation to rename.
@@ -226,12 +225,12 @@ module Slack
226
225
  def conversations_rename(options = {})
227
226
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
228
227
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
229
- 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]
230
229
  post('conversations.rename', options)
231
230
  end
232
231
 
233
232
  #
234
- # This Conversations API method returns an entire thread (a message plus all the messages in reply to it), while conversations.history method returns only parent messages.
233
+ # Retrieve a thread of messages posted to a conversation
235
234
  #
236
235
  # @option options [channel] :channel
237
236
  # Conversation ID to fetch thread from.
@@ -252,7 +251,7 @@ module Slack
252
251
  def conversations_replies(options = {})
253
252
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
254
253
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
255
- 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]
256
255
  if block_given?
257
256
  Pagination::Cursor.new(self, :conversations_replies, options).each do |page|
258
257
  yield page
@@ -263,7 +262,7 @@ module Slack
263
262
  end
264
263
 
265
264
  #
266
- # This method is used to change the purpose of a conversation. The calling user must be a member of the conversation. Not all conversation types may have a purpose set.
265
+ # Sets the purpose for a conversation.
267
266
  #
268
267
  # @option options [channel] :channel
269
268
  # Conversation to set the purpose of.
@@ -274,12 +273,12 @@ module Slack
274
273
  def conversations_setPurpose(options = {})
275
274
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
276
275
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
277
- 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]
278
277
  post('conversations.setPurpose', options)
279
278
  end
280
279
 
281
280
  #
282
- # This method is used to change the topic of a conversation. The calling user must be a member of the conversation. Not all conversation types support a new topic.
281
+ # Sets the topic for a conversation.
283
282
  #
284
283
  # @option options [channel] :channel
285
284
  # Conversation to set the topic of.
@@ -290,12 +289,12 @@ module Slack
290
289
  def conversations_setTopic(options = {})
291
290
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
292
291
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
293
- 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]
294
293
  post('conversations.setTopic', options)
295
294
  end
296
295
 
297
296
  #
298
- # This method unarchives a conversation. The calling user is added to the conversation.
297
+ # Reverses conversation archival.
299
298
  #
300
299
  # @option options [channel] :channel
301
300
  # ID of conversation to unarchive.
@@ -303,7 +302,7 @@ module Slack
303
302
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
304
303
  def conversations_unarchive(options = {})
305
304
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
306
- 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]
307
306
  post('conversations.unarchive', options)
308
307
  end
309
308
  end