slack-ruby-client 0.14.4 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (352) 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 +104 -47
  5. data/.travis.yml +1 -5
  6. data/CHANGELOG.md +41 -2
  7. data/CONTRIBUTING.md +17 -6
  8. data/Dangerfile +2 -1
  9. data/Gemfile +2 -2
  10. data/README.md +94 -53
  11. data/Rakefile +1 -0
  12. data/UPGRADING.md +20 -2
  13. data/bin/commands.rb +30 -0
  14. data/bin/commands/admin_analytics.rb +15 -0
  15. data/bin/commands/admin_apps.rb +40 -0
  16. data/bin/commands/admin_apps_approved.rb +17 -0
  17. data/bin/commands/admin_apps_requests.rb +16 -0
  18. data/bin/commands/admin_apps_restricted.rb +17 -0
  19. data/bin/commands/admin_barriers.rb +47 -0
  20. data/bin/commands/admin_conversations.rb +169 -0
  21. data/bin/commands/admin_conversations_ekm.rb +17 -0
  22. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  23. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  24. data/bin/commands/admin_emoji.rb +54 -0
  25. data/bin/commands/admin_inviteRequests.rb +36 -0
  26. data/bin/commands/admin_inviteRequests_approved.rb +16 -0
  27. data/bin/commands/admin_inviteRequests_denied.rb +16 -0
  28. data/bin/commands/admin_teams.rb +27 -0
  29. data/bin/commands/admin_teams_admins.rb +16 -0
  30. data/bin/commands/admin_teams_owners.rb +16 -0
  31. data/bin/commands/admin_teams_settings.rb +64 -0
  32. data/bin/commands/admin_usergroups.rb +48 -0
  33. data/bin/commands/admin_users.rb +97 -0
  34. data/bin/commands/admin_users_session.rb +25 -2
  35. data/bin/commands/api.rb +3 -3
  36. data/bin/commands/apps.rb +3 -2
  37. data/bin/commands/apps_connections.rb +13 -0
  38. data/bin/commands/apps_event_authorizations.rb +16 -0
  39. data/bin/commands/apps_permissions.rb +5 -4
  40. data/bin/commands/apps_permissions_resources.rb +3 -2
  41. data/bin/commands/apps_permissions_scopes.rb +3 -2
  42. data/bin/commands/apps_permissions_users.rb +5 -4
  43. data/bin/commands/auth.rb +5 -4
  44. data/bin/commands/auth_teams.rb +16 -0
  45. data/bin/commands/bots.rb +4 -2
  46. data/bin/commands/calls.rb +52 -0
  47. data/bin/commands/calls_participants.rb +25 -0
  48. data/bin/commands/channels.rb +37 -33
  49. data/bin/commands/chat.rb +34 -33
  50. data/bin/commands/chat_scheduledMessages.rb +4 -2
  51. data/bin/commands/conversations.rb +50 -38
  52. data/bin/commands/dialog.rb +3 -2
  53. data/bin/commands/dnd.rb +10 -9
  54. data/bin/commands/emoji.rb +3 -2
  55. data/bin/commands/files.rb +16 -13
  56. data/bin/commands/files_comments.rb +3 -2
  57. data/bin/commands/files_remote.rb +78 -0
  58. data/bin/commands/groups.rb +38 -35
  59. data/bin/commands/im.rb +14 -13
  60. data/bin/commands/migration.rb +4 -2
  61. data/bin/commands/mpim.rb +14 -13
  62. data/bin/commands/oauth.rb +6 -5
  63. data/bin/commands/oauth_v2.rb +17 -0
  64. data/bin/commands/pins.rb +7 -10
  65. data/bin/commands/reactions.rb +11 -11
  66. data/bin/commands/reminders.rb +11 -10
  67. data/bin/commands/rtm.rb +5 -4
  68. data/bin/commands/search.rb +11 -7
  69. data/bin/commands/stars.rb +7 -6
  70. data/bin/commands/team.rb +12 -8
  71. data/bin/commands/team_profile.rb +3 -2
  72. data/bin/commands/usergroups.rb +17 -11
  73. data/bin/commands/usergroups_users.rb +7 -4
  74. data/bin/commands/users.rb +26 -23
  75. data/bin/commands/users_admin.rb +1 -0
  76. data/bin/commands/users_prefs.rb +1 -0
  77. data/bin/commands/users_profile.rb +6 -5
  78. data/bin/commands/views.rb +48 -0
  79. data/bin/commands/workflows.rb +38 -0
  80. data/bin/slack +1 -2
  81. data/examples/hi_real_time_and_web/Gemfile +1 -0
  82. data/examples/hi_real_time_and_web/hi.rb +7 -3
  83. data/examples/hi_real_time_async_async/Gemfile +1 -0
  84. data/examples/hi_real_time_async_async/hi.rb +6 -2
  85. data/examples/hi_web/Gemfile +1 -0
  86. data/examples/hi_web/hi.rb +1 -0
  87. data/examples/new_ticket/Gemfile +1 -0
  88. data/examples/new_ticket/new_ticket.rb +1 -0
  89. data/lib/slack-ruby-client.rb +6 -4
  90. data/lib/slack.rb +1 -0
  91. data/lib/slack/config.rb +1 -0
  92. data/lib/slack/events/config.rb +1 -0
  93. data/lib/slack/events/request.rb +8 -2
  94. data/lib/slack/logger.rb +6 -5
  95. data/lib/slack/messages/formatting.rb +1 -0
  96. data/lib/slack/messages/message.rb +1 -4
  97. data/lib/slack/real_time/api/message.rb +3 -1
  98. data/lib/slack/real_time/api/message_id.rb +1 -0
  99. data/lib/slack/real_time/api/ping.rb +5 -2
  100. data/lib/slack/real_time/api/typing.rb +3 -1
  101. data/lib/slack/real_time/client.rb +21 -13
  102. data/lib/slack/real_time/concurrency.rb +1 -2
  103. data/lib/slack/real_time/concurrency/async.rb +12 -6
  104. data/lib/slack/real_time/config.rb +9 -3
  105. data/lib/slack/real_time/models.rb +1 -0
  106. data/lib/slack/real_time/models/base.rb +1 -4
  107. data/lib/slack/real_time/models/bot.rb +1 -0
  108. data/lib/slack/real_time/models/channel.rb +1 -0
  109. data/lib/slack/real_time/models/group.rb +1 -0
  110. data/lib/slack/real_time/models/im.rb +1 -0
  111. data/lib/slack/real_time/models/team.rb +1 -0
  112. data/lib/slack/real_time/models/user.rb +1 -0
  113. data/lib/slack/real_time/socket.rb +16 -13
  114. data/lib/slack/real_time/stores.rb +1 -0
  115. data/lib/slack/real_time/stores/base.rb +4 -1
  116. data/lib/slack/real_time/stores/starter.rb +1 -0
  117. data/lib/slack/real_time/stores/store.rb +16 -25
  118. data/lib/slack/version.rb +2 -1
  119. data/lib/slack/web/api/endpoints.rb +60 -0
  120. data/lib/slack/web/api/endpoints/admin_analytics.rb +26 -0
  121. data/lib/slack/web/api/endpoints/admin_apps.rb +62 -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_barriers.rb +82 -0
  126. data/lib/slack/web/api/endpoints/admin_conversations.rb +260 -0
  127. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  128. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  129. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  130. data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
  131. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
  132. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
  133. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
  134. data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
  135. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
  136. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
  137. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
  138. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  139. data/lib/slack/web/api/endpoints/admin_users.rb +161 -0
  140. data/lib/slack/web/api/endpoints/admin_users_session.rb +40 -1
  141. data/lib/slack/web/api/endpoints/api.rb +2 -3
  142. data/lib/slack/web/api/endpoints/apps.rb +2 -1
  143. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  144. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  145. data/lib/slack/web/api/endpoints/apps_permissions.rb +3 -2
  146. data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +2 -1
  147. data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +2 -1
  148. data/lib/slack/web/api/endpoints/apps_permissions_users.rb +3 -2
  149. data/lib/slack/web/api/endpoints/auth.rb +3 -2
  150. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  151. data/lib/slack/web/api/endpoints/bots.rb +4 -1
  152. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  153. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  154. data/lib/slack/web/api/endpoints/channels.rb +52 -31
  155. data/lib/slack/web/api/endpoints/chat.rb +31 -30
  156. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +5 -2
  157. data/lib/slack/web/api/endpoints/conversations.rb +55 -36
  158. data/lib/slack/web/api/endpoints/dialog.rb +2 -1
  159. data/lib/slack/web/api/endpoints/dnd.rb +5 -4
  160. data/lib/slack/web/api/endpoints/emoji.rb +2 -1
  161. data/lib/slack/web/api/endpoints/files.rb +13 -8
  162. data/lib/slack/web/api/endpoints/files_comments.rb +2 -1
  163. data/lib/slack/web/api/endpoints/files_remote.rb +127 -0
  164. data/lib/slack/web/api/endpoints/groups.rb +39 -24
  165. data/lib/slack/web/api/endpoints/im.rb +17 -12
  166. data/lib/slack/web/api/endpoints/migration.rb +4 -1
  167. data/lib/slack/web/api/endpoints/mpim.rb +18 -13
  168. data/lib/slack/web/api/endpoints/oauth.rb +4 -6
  169. data/lib/slack/web/api/endpoints/oauth_v2.rb +30 -0
  170. data/lib/slack/web/api/endpoints/pins.rb +7 -16
  171. data/lib/slack/web/api/endpoints/reactions.rb +14 -15
  172. data/lib/slack/web/api/endpoints/reminders.rb +6 -5
  173. data/lib/slack/web/api/endpoints/rtm.rb +3 -2
  174. data/lib/slack/web/api/endpoints/search.rb +10 -3
  175. data/lib/slack/web/api/endpoints/stars.rb +6 -7
  176. data/lib/slack/web/api/endpoints/team.rb +11 -5
  177. data/lib/slack/web/api/endpoints/team_profile.rb +2 -1
  178. data/lib/slack/web/api/endpoints/usergroups.rb +16 -5
  179. data/lib/slack/web/api/endpoints/usergroups_users.rb +7 -2
  180. data/lib/slack/web/api/endpoints/users.rb +18 -21
  181. data/lib/slack/web/api/endpoints/users_admin.rb +1 -0
  182. data/lib/slack/web/api/endpoints/users_prefs.rb +1 -0
  183. data/lib/slack/web/api/endpoints/users_profile.rb +4 -3
  184. data/lib/slack/web/api/endpoints/views.rb +97 -0
  185. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  186. data/lib/slack/web/api/error.rb +1 -0
  187. data/lib/slack/web/api/errors.rb +850 -0
  188. data/lib/slack/web/api/errors/internal_error.rb +14 -0
  189. data/lib/slack/web/api/errors/slack_error.rb +14 -1
  190. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -0
  191. data/lib/slack/web/api/mixins.rb +2 -0
  192. data/lib/slack/web/api/mixins/channels.id.rb +2 -3
  193. data/lib/slack/web/api/mixins/conversations.id.rb +25 -0
  194. data/lib/slack/web/api/mixins/groups.id.rb +2 -3
  195. data/lib/slack/web/api/mixins/ids.id.rb +3 -2
  196. data/lib/slack/web/api/mixins/users.id.rb +2 -3
  197. data/lib/slack/web/api/mixins/users.search.rb +1 -0
  198. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +29 -26
  199. data/lib/slack/web/api/patches/views.1.view-json.patch +40 -0
  200. data/lib/slack/web/api/patches/views.1.views-published.patch +16 -0
  201. data/lib/slack/web/api/templates/command.erb +1 -0
  202. data/lib/slack/web/api/templates/commands.erb +1 -0
  203. data/lib/slack/web/api/templates/endpoints.erb +2 -0
  204. data/lib/slack/web/api/templates/errors.erb +20 -0
  205. data/lib/slack/web/api/templates/method.erb +5 -1
  206. data/lib/slack/web/api/templates/method_spec.erb +2 -1
  207. data/lib/slack/web/client.rb +2 -1
  208. data/lib/slack/web/config.rb +3 -0
  209. data/lib/slack/web/faraday/connection.rb +24 -20
  210. data/lib/slack/web/faraday/request.rb +1 -0
  211. data/lib/slack/web/faraday/response/raise_error.rb +25 -6
  212. data/lib/slack/web/faraday/response/wrap_error.rb +18 -0
  213. data/lib/slack/web/pagination/cursor.rb +3 -2
  214. data/lib/slack_ruby_client.rb +1 -0
  215. data/lib/tasks/git.rake +1 -0
  216. data/lib/tasks/real_time.rake +13 -5
  217. data/lib/tasks/update.rake +1 -0
  218. data/lib/tasks/web.rake +34 -10
  219. data/screenshots/create-app.png +0 -0
  220. data/slack-ruby-client.gemspec +6 -3
  221. data/spec/fixtures/slack/web/channels_info.yml +108 -15
  222. data/spec/fixtures/slack/web/conversations_setTopic.yml +69 -0
  223. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +142 -0
  224. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +208 -0
  225. data/spec/fixtures/slack/web/views_open_error.yml +76 -0
  226. data/spec/integration/integration_spec.rb +16 -17
  227. data/spec/slack/config_spec.rb +2 -0
  228. data/spec/slack/events/config_spec.rb +8 -4
  229. data/spec/slack/events/request_spec.rb +74 -40
  230. data/spec/slack/messages/formatting_spec.rb +25 -13
  231. data/spec/slack/real_time/api/message_spec.rb +6 -1
  232. data/spec/slack/real_time/api/ping_spec.rb +2 -0
  233. data/spec/slack/real_time/api/typing_spec.rb +5 -1
  234. data/spec/slack/real_time/client_spec.rb +153 -38
  235. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +2 -0
  236. data/spec/slack/real_time/event_handlers/bot_spec.rb +2 -1
  237. data/spec/slack/real_time/event_handlers/channel_spec.rb +9 -6
  238. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +2 -1
  239. data/spec/slack/real_time/event_handlers/group_spec.rb +5 -4
  240. data/spec/slack/real_time/event_handlers/im_spec.rb +4 -3
  241. data/spec/slack/real_time/event_handlers/team_spec.rb +3 -1
  242. data/spec/slack/real_time/event_handlers/user_spec.rb +1 -0
  243. data/spec/slack/real_time/rtm_connect_spec.rb +1 -0
  244. data/spec/slack/real_time/rtm_start_spec.rb +1 -0
  245. data/spec/slack/real_time/store_spec.rb +2 -1
  246. data/spec/slack/slack_spec.rb +37 -5
  247. data/spec/slack/version_spec.rb +2 -1
  248. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  249. data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
  250. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +8 -0
  251. data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
  252. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +13 -0
  253. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  254. data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +8 -0
  255. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  256. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +98 -0
  257. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +32 -0
  258. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
  259. data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
  260. data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
  261. data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
  262. data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
  263. data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
  264. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
  265. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
  266. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  267. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +9 -0
  268. data/spec/slack/web/api/endpoints/admin_users_spec.rb +67 -0
  269. data/spec/slack/web/api/endpoints/api_spec.rb +1 -0
  270. data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
  271. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  272. data/spec/slack/web/api/endpoints/apps_permissions_resources_spec.rb +1 -0
  273. data/spec/slack/web/api/endpoints/apps_permissions_scopes_spec.rb +1 -0
  274. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +3 -2
  275. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +4 -3
  276. data/spec/slack/web/api/endpoints/apps_spec.rb +3 -2
  277. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
  278. data/spec/slack/web/api/endpoints/bots_spec.rb +1 -0
  279. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  280. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  281. data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +1 -0
  282. data/spec/slack/web/api/endpoints/conversations_spec.rb +21 -12
  283. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +5 -1
  284. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +5 -3
  285. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +80 -25
  286. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +12 -4
  287. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +2 -0
  288. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +6 -1
  289. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +95 -0
  290. data/spec/slack/web/api/endpoints/dnd_spec.rb +1 -0
  291. data/spec/slack/web/api/endpoints/emoji_spec.rb +1 -0
  292. data/spec/slack/web/api/endpoints/files_comments_spec.rb +3 -2
  293. data/spec/slack/web/api/endpoints/files_remote_spec.rb +24 -0
  294. data/spec/slack/web/api/endpoints/files_spec.rb +5 -4
  295. data/spec/slack/web/api/endpoints/im_spec.rb +5 -4
  296. data/spec/slack/web/api/endpoints/migration_spec.rb +1 -0
  297. data/spec/slack/web/api/endpoints/mpim_spec.rb +5 -4
  298. data/spec/slack/web/api/endpoints/oauth_spec.rb +4 -14
  299. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +13 -0
  300. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -0
  301. data/spec/slack/web/api/endpoints/reactions_spec.rb +8 -1
  302. data/spec/slack/web/api/endpoints/reminders_spec.rb +3 -2
  303. data/spec/slack/web/api/endpoints/rtm_spec.rb +1 -0
  304. data/spec/slack/web/api/endpoints/search_spec.rb +1 -0
  305. data/spec/slack/web/api/endpoints/stars_spec.rb +1 -0
  306. data/spec/slack/web/api/endpoints/team_profile_spec.rb +1 -0
  307. data/spec/slack/web/api/endpoints/team_spec.rb +1 -0
  308. data/spec/slack/web/api/endpoints/usergroups_spec.rb +1 -0
  309. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +3 -2
  310. data/spec/slack/web/api/endpoints/users_admin_spec.rb +1 -0
  311. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +1 -0
  312. data/spec/slack/web/api/endpoints/users_profile_spec.rb +1 -0
  313. data/spec/slack/web/api/endpoints/views_spec.rb +29 -0
  314. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  315. data/spec/slack/web/api/error_spec.rb +4 -2
  316. data/spec/slack/web/api/errors/slack_error_spec.rb +26 -2
  317. data/spec/slack/web/api/mixins/channels_spec.rb +17 -7
  318. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  319. data/spec/slack/web/api/mixins/conversations_spec.rb +43 -0
  320. data/spec/slack/web/api/mixins/groups_spec.rb +17 -7
  321. data/spec/slack/web/api/mixins/users_spec.rb +17 -8
  322. data/spec/slack/web/api/pagination/cursor_spec.rb +40 -10
  323. data/spec/slack/web/client_spec.rb +171 -18
  324. data/spec/slack/web/faraday/response/raise_error_spec.rb +47 -12
  325. data/spec/spec_helper.rb +2 -1
  326. data/spec/support/queue_with_timeout.rb +1 -0
  327. data/spec/support/real_time/concurrency/mock.rb +1 -0
  328. data/spec/support/real_time/connected_client.rb +9 -3
  329. data/spec/support/real_time/event.rb +1 -0
  330. data/spec/support/token.rb +1 -0
  331. data/spec/support/vcr.rb +5 -0
  332. metadata +190 -46
  333. data/examples/hi_real_time/Gemfile +0 -5
  334. data/examples/hi_real_time/hi.gif +0 -0
  335. data/examples/hi_real_time/hi.rb +0 -37
  336. data/examples/hi_real_time_async_celluloid/Gemfile +0 -6
  337. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  338. data/examples/hi_real_time_async_celluloid/hi.rb +0 -35
  339. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -6
  340. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  341. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -35
  342. data/lib/slack/real_time/concurrency/celluloid.rb +0 -136
  343. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -82
  344. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  345. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  346. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  347. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  348. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
  349. data/screenshots/register-bot.png +0 -0
  350. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -111
  351. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -49
  352. data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -14
@@ -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. See authorship below. Use with bot tokens requires chat:write.customize.
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. See authorship below. Use with bot tokens requires chat:write.customize.
159
160
  # @option options [Object] :link_names
160
161
  # Find and link channel names and usernames.
161
162
  # @option options [Object] :mrkdwn
@@ -171,7 +172,7 @@ module Slack
171
172
  # @option options [Object] :unfurl_media
172
173
  # Pass false to disable unfurling of media content.
173
174
  # @option options [Object] :username
174
- # Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.
175
+ # Set your bot's user name. See authorship below. Use with bot tokens requires chat:write.customize.
175
176
  # @see https://api.slack.com/methods/chat.postMessage
176
177
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
177
178
  def chat_postMessage(options = {})
@@ -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.
@@ -18,10 +19,12 @@ module Slack
18
19
  # Maximum number of original entries to return.
19
20
  # @option options [timestamp] :oldest
20
21
  # A UNIX timestamp of the oldest value in the time range.
22
+ # @option options [Object] :team_id
23
+ # encoded team id to list channels in, required if org token is used.
21
24
  # @see https://api.slack.com/methods/chat.scheduledMessages.list
22
25
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat.scheduledMessages/chat.scheduledMessages.list.json
23
26
  def chat_scheduledMessages_list(options = {})
24
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
27
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
25
28
  if block_given?
26
29
  Pagination::Cursor.new(self, :chat_scheduledMessages_list, options).each do |page|
27
30
  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,19 @@ 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.
42
+ # @option options [Object] :team_id
43
+ # encoded team id to create the channel in, required if org token is used.
43
44
  # @see https://api.slack.com/methods/conversations.create
44
45
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
45
46
  def conversations_create(options = {})
@@ -48,7 +49,7 @@ module Slack
48
49
  end
49
50
 
50
51
  #
51
- # This method returns a portion of message events from the specified conversation.
52
+ # Fetches a conversation's history of messages and events.
52
53
  #
53
54
  # @option options [channel] :channel
54
55
  # Conversation ID to fetch history for.
@@ -66,7 +67,7 @@ module Slack
66
67
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.history.json
67
68
  def conversations_history(options = {})
68
69
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
69
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
70
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
70
71
  if block_given?
71
72
  Pagination::Cursor.new(self, :conversations_history, options).each do |page|
72
73
  yield page
@@ -77,7 +78,7 @@ module Slack
77
78
  end
78
79
 
79
80
  #
80
- # This Conversations API method returns information about a workspace conversation.
81
+ # Retrieve information about a conversation.
81
82
  #
82
83
  # @option options [channel] :channel
83
84
  # Conversation ID to learn more about.
@@ -89,28 +90,28 @@ module Slack
89
90
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.info.json
90
91
  def conversations_info(options = {})
91
92
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
92
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
93
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
93
94
  post('conversations.info', options)
94
95
  end
95
96
 
96
97
  #
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.
98
+ # Invites users to a channel.
98
99
  #
99
100
  # @option options [channel] :channel
100
101
  # The ID of the public or private channel to invite user(s) to.
101
102
  # @option options [Object] :users
102
- # A comma separated list of user IDs. Up to 30 users may be listed.
103
+ # A comma separated list of user IDs. Up to 1000 users may be listed.
103
104
  # @see https://api.slack.com/methods/conversations.invite
104
105
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.invite.json
105
106
  def conversations_invite(options = {})
106
107
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
107
108
  throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
108
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
109
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
109
110
  post('conversations.invite', options)
110
111
  end
111
112
 
112
113
  #
113
- # This Conversations API method joins a user to an existing conversation.
114
+ # Joins an existing conversation.
114
115
  #
115
116
  # @option options [channel] :channel
116
117
  # ID of conversation to join.
@@ -118,12 +119,12 @@ module Slack
118
119
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.join.json
119
120
  def conversations_join(options = {})
120
121
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
121
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
122
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
122
123
  post('conversations.join', options)
123
124
  end
124
125
 
125
126
  #
126
- # This Conversations API method allows a user to remove another member from a channel.
127
+ # Removes a user from a conversation.
127
128
  #
128
129
  # @option options [channel] :channel
129
130
  # ID of conversation to remove user from.
@@ -134,13 +135,13 @@ module Slack
134
135
  def conversations_kick(options = {})
135
136
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
136
137
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
137
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
138
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
138
139
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
139
140
  post('conversations.kick', options)
140
141
  end
141
142
 
142
143
  #
143
- # This Conversations API method makes like a tree and leaves a conversation.
144
+ # Leaves a conversation.
144
145
  #
145
146
  # @option options [channel] :channel
146
147
  # Conversation to leave.
@@ -148,12 +149,12 @@ module Slack
148
149
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.leave.json
149
150
  def conversations_leave(options = {})
150
151
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
151
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
152
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
152
153
  post('conversations.leave', options)
153
154
  end
154
155
 
155
156
  #
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.
157
+ # Lists all channels in a Slack team.
157
158
  #
158
159
  # @option options [Object] :cursor
159
160
  # 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.
@@ -161,6 +162,8 @@ module Slack
161
162
  # Set to true to exclude archived channels from the list.
162
163
  # @option options [Object] :limit
163
164
  # The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000.
165
+ # @option options [Object] :team_id
166
+ # encoded team id to list channels in, required if org token is used.
164
167
  # @option options [Object] :types
165
168
  # Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
166
169
  # @see https://api.slack.com/methods/conversations.list
@@ -176,7 +179,23 @@ module Slack
176
179
  end
177
180
 
178
181
  #
179
- # This Conversations API method returns a paginated list of members party to a conversation.
182
+ # Sets the read cursor in a channel.
183
+ #
184
+ # @option options [channel] :channel
185
+ # Channel or conversation to set the read cursor for.
186
+ # @option options [timestamp] :ts
187
+ # Unique identifier of message you want marked as most recently seen in this conversation.
188
+ # @see https://api.slack.com/methods/conversations.mark
189
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.mark.json
190
+ def conversations_mark(options = {})
191
+ throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
192
+ throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
193
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
194
+ post('conversations.mark', options)
195
+ end
196
+
197
+ #
198
+ # Retrieve members of a conversation.
180
199
  #
181
200
  # @option options [channel] :channel
182
201
  # ID of the conversation to retrieve members for.
@@ -188,7 +207,7 @@ module Slack
188
207
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.members.json
189
208
  def conversations_members(options = {})
190
209
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
191
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
210
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
192
211
  if block_given?
193
212
  Pagination::Cursor.new(self, :conversations_members, options).each do |page|
194
213
  yield page
@@ -199,7 +218,7 @@ module Slack
199
218
  end
200
219
 
201
220
  #
202
- # This Conversations API method opens a multi-person direct message or just a 1:1 direct message.
221
+ # Opens or resumes a direct message or multi-person direct message.
203
222
  #
204
223
  # @option options [channel] :channel
205
224
  # Resume a conversation by supplying an im or mpim's ID. Or provide the users field instead.
@@ -210,12 +229,12 @@ module Slack
210
229
  # @see https://api.slack.com/methods/conversations.open
211
230
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.open.json
212
231
  def conversations_open(options = {})
213
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
232
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
214
233
  post('conversations.open', options)
215
234
  end
216
235
 
217
236
  #
218
- # This method renames a conversation. Some types of conversations cannot be renamed.
237
+ # Renames a conversation.
219
238
  #
220
239
  # @option options [channel] :channel
221
240
  # ID of conversation to rename.
@@ -226,17 +245,17 @@ module Slack
226
245
  def conversations_rename(options = {})
227
246
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
228
247
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
229
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
248
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
230
249
  post('conversations.rename', options)
231
250
  end
232
251
 
233
252
  #
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.
253
+ # Retrieve a thread of messages posted to a conversation
235
254
  #
236
255
  # @option options [channel] :channel
237
256
  # Conversation ID to fetch thread from.
238
257
  # @option options [timestamp] :ts
239
- # Unique identifier of a thread's parent message.
258
+ # Unique identifier of a thread's parent message. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message.
240
259
  # @option options [Object] :cursor
241
260
  # 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.
242
261
  # @option options [Object] :inclusive
@@ -252,7 +271,7 @@ module Slack
252
271
  def conversations_replies(options = {})
253
272
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
254
273
  throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
255
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
274
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
256
275
  if block_given?
257
276
  Pagination::Cursor.new(self, :conversations_replies, options).each do |page|
258
277
  yield page
@@ -263,7 +282,7 @@ module Slack
263
282
  end
264
283
 
265
284
  #
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.
285
+ # Sets the purpose for a conversation.
267
286
  #
268
287
  # @option options [channel] :channel
269
288
  # Conversation to set the purpose of.
@@ -274,12 +293,12 @@ module Slack
274
293
  def conversations_setPurpose(options = {})
275
294
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
276
295
  throw ArgumentError.new('Required arguments :purpose missing') if options[:purpose].nil?
277
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
296
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
278
297
  post('conversations.setPurpose', options)
279
298
  end
280
299
 
281
300
  #
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.
301
+ # Sets the topic for a conversation.
283
302
  #
284
303
  # @option options [channel] :channel
285
304
  # Conversation to set the topic of.
@@ -290,12 +309,12 @@ module Slack
290
309
  def conversations_setTopic(options = {})
291
310
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
292
311
  throw ArgumentError.new('Required arguments :topic missing') if options[:topic].nil?
293
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
312
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
294
313
  post('conversations.setTopic', options)
295
314
  end
296
315
 
297
316
  #
298
- # This method unarchives a conversation. The calling user is added to the conversation.
317
+ # Reverses conversation archival.
299
318
  #
300
319
  # @option options [channel] :channel
301
320
  # ID of conversation to unarchive.
@@ -303,7 +322,7 @@ module Slack
303
322
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.unarchive.json
304
323
  def conversations_unarchive(options = {})
305
324
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
306
- options = options.merge(channel: channels_id(options)['channel']['id']) if options[:channel]
325
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
307
326
  post('conversations.unarchive', options)
308
327
  end
309
328
  end