slack-ruby-client 0.13.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (402) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/workflows/integration_test.yml +26 -0
  4. data/.github/workflows/lint.yml +14 -0
  5. data/.github/workflows/pr_lint.yml +21 -0
  6. data/.github/workflows/test.yml +36 -0
  7. data/.gitignore +5 -3
  8. data/.rubocop.yml +34 -5
  9. data/.rubocop_todo.yml +180 -46
  10. data/.ruby-version +1 -0
  11. data/CHANGELOG.md +119 -2
  12. data/CONTRIBUTING.md +23 -11
  13. data/Dangerfile +2 -0
  14. data/Gemfile +22 -5
  15. data/Gemfile.danger +6 -0
  16. data/LICENSE.md +1 -1
  17. data/README.md +236 -101
  18. data/RELEASING.md +2 -2
  19. data/Rakefile +2 -1
  20. data/UPGRADING.md +100 -2
  21. data/bin/commands/admin_analytics.rb +16 -0
  22. data/bin/commands/admin_apps.rb +51 -0
  23. data/bin/commands/admin_apps_approved.rb +17 -0
  24. data/bin/commands/admin_apps_requests.rb +28 -0
  25. data/bin/commands/admin_apps_restricted.rb +17 -0
  26. data/bin/commands/admin_audit_anomaly_allow.rb +23 -0
  27. data/bin/commands/admin_auth_policy.rb +39 -0
  28. data/bin/commands/admin_barriers.rb +47 -0
  29. data/bin/commands/admin_conversations.rb +171 -0
  30. data/bin/commands/admin_conversations_ekm.rb +17 -0
  31. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  32. data/bin/commands/admin_emoji.rb +54 -0
  33. data/bin/commands/admin_inviteRequests.rb +36 -0
  34. data/bin/commands/admin_inviteRequests_approved.rb +16 -0
  35. data/bin/commands/admin_inviteRequests_denied.rb +16 -0
  36. data/bin/commands/admin_teams.rb +27 -0
  37. data/bin/commands/admin_teams_admins.rb +16 -0
  38. data/bin/commands/admin_teams_owners.rb +16 -0
  39. data/bin/commands/admin_teams_settings.rb +64 -0
  40. data/bin/commands/admin_usergroups.rb +48 -0
  41. data/bin/commands/admin_users.rb +98 -0
  42. data/bin/commands/admin_users_session.rb +78 -0
  43. data/bin/commands/admin_users_unsupportedVersions.rb +15 -0
  44. data/bin/commands/api.rb +1 -1
  45. data/bin/commands/apps.rb +15 -0
  46. data/bin/commands/apps_connections.rb +13 -0
  47. data/bin/commands/apps_event_authorizations.rb +16 -0
  48. data/bin/commands/apps_manifest.rb +52 -0
  49. data/bin/commands/auth.rb +1 -0
  50. data/bin/commands/auth_teams.rb +16 -0
  51. data/bin/commands/bookmarks.rb +53 -0
  52. data/bin/commands/bots.rb +2 -0
  53. data/bin/commands/calls.rb +52 -0
  54. data/bin/commands/calls_participants.rb +25 -0
  55. data/bin/commands/chat.rb +61 -14
  56. data/bin/commands/chat_scheduledMessages.rb +19 -0
  57. data/bin/commands/conversations.rb +82 -10
  58. data/bin/commands/dialog.rb +1 -0
  59. data/bin/commands/dnd.rb +6 -3
  60. data/bin/commands/emoji.rb +1 -0
  61. data/bin/commands/files.rb +34 -18
  62. data/bin/commands/files_comments.rb +1 -21
  63. data/bin/commands/files_remote.rb +78 -0
  64. data/bin/commands/migration.rb +2 -0
  65. data/bin/commands/oauth.rb +2 -14
  66. data/bin/commands/oauth_v2.rb +29 -0
  67. data/bin/commands/openid_connect.rb +27 -0
  68. data/bin/commands/pins.rb +3 -6
  69. data/bin/commands/reactions.rb +3 -3
  70. data/bin/commands/reminders.rb +7 -0
  71. data/bin/commands/rtm.rb +1 -15
  72. data/bin/commands/search.rb +6 -1
  73. data/bin/commands/stars.rb +8 -6
  74. data/bin/commands/team.rb +6 -0
  75. data/bin/commands/team_billing.rb +13 -0
  76. data/bin/commands/team_preferences.rb +13 -0
  77. data/bin/commands/team_profile.rb +1 -0
  78. data/bin/commands/tooling_tokens.rb +14 -0
  79. data/bin/commands/usergroups.rb +7 -1
  80. data/bin/commands/usergroups_users.rb +3 -0
  81. data/bin/commands/users.rb +6 -4
  82. data/bin/commands/users_admin.rb +1 -0
  83. data/bin/commands/users_prefs.rb +1 -0
  84. data/bin/commands/users_profile.rb +6 -5
  85. data/bin/commands/views.rb +50 -0
  86. data/bin/commands/workflows.rb +38 -0
  87. data/bin/commands.rb +41 -8
  88. data/bin/slack +3 -4
  89. data/examples/hi_real_time_and_web/Gemfile +1 -0
  90. data/examples/hi_real_time_and_web/hi.rb +7 -3
  91. data/examples/hi_real_time_async_async/Gemfile +1 -0
  92. data/examples/hi_real_time_async_async/hi.rb +6 -2
  93. data/examples/hi_web/Gemfile +1 -0
  94. data/examples/hi_web/hi.rb +1 -0
  95. data/examples/new_ticket/Gemfile +1 -0
  96. data/examples/new_ticket/new_ticket.rb +1 -0
  97. data/lib/slack/config.rb +2 -2
  98. data/lib/slack/events/config.rb +32 -0
  99. data/lib/slack/events/request.rb +72 -0
  100. data/lib/slack/logger.rb +6 -5
  101. data/lib/slack/messages/formatting.rb +1 -0
  102. data/lib/slack/messages/message.rb +1 -4
  103. data/lib/slack/real_time/api/message.rb +6 -3
  104. data/lib/slack/real_time/api/message_id.rb +1 -0
  105. data/lib/slack/real_time/api/ping.rb +5 -2
  106. data/lib/slack/real_time/api/templates/event_handler.erb +5 -1
  107. data/lib/slack/real_time/api/typing.rb +5 -2
  108. data/lib/slack/real_time/client.rb +105 -54
  109. data/lib/slack/real_time/concurrency/async.rb +77 -6
  110. data/lib/slack/real_time/concurrency.rb +1 -2
  111. data/lib/slack/real_time/config.rb +9 -13
  112. data/lib/slack/real_time/models/base.rb +1 -4
  113. data/lib/slack/real_time/models/bot.rb +1 -0
  114. data/lib/slack/real_time/models/channel.rb +5 -0
  115. data/lib/slack/real_time/models/im.rb +1 -0
  116. data/lib/slack/real_time/models/{group.rb → mpim.rb} +2 -1
  117. data/lib/slack/real_time/models/team.rb +1 -0
  118. data/lib/slack/real_time/models/user.rb +1 -0
  119. data/lib/slack/real_time/models.rb +3 -1
  120. data/lib/slack/real_time/socket.rb +45 -17
  121. data/lib/slack/real_time/stores/base.rb +28 -14
  122. data/lib/slack/real_time/stores/starter.rb +325 -297
  123. data/lib/slack/real_time/stores/store.rb +271 -196
  124. data/lib/slack/real_time/stores.rb +2 -7
  125. data/lib/slack/version.rb +2 -1
  126. data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
  127. data/lib/slack/web/api/endpoints/admin_apps.rb +78 -0
  128. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
  129. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +51 -0
  130. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
  131. data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +34 -0
  132. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  133. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  134. data/lib/slack/web/api/endpoints/admin_conversations.rb +264 -0
  135. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  136. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  137. data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
  138. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
  139. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
  140. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
  141. data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
  142. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
  143. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
  144. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
  145. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  146. data/lib/slack/web/api/endpoints/admin_users.rb +163 -0
  147. data/lib/slack/web/api/endpoints/admin_users_session.rb +122 -0
  148. data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
  149. data/lib/slack/web/api/endpoints/api.rb +2 -3
  150. data/lib/slack/web/api/endpoints/apps.rb +27 -0
  151. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  152. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  153. data/lib/slack/web/api/endpoints/apps_manifest.rb +77 -0
  154. data/lib/slack/web/api/endpoints/auth.rb +2 -1
  155. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  156. data/lib/slack/web/api/endpoints/bookmarks.rb +88 -0
  157. data/lib/slack/web/api/endpoints/bots.rb +4 -1
  158. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  159. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  160. data/lib/slack/web/api/endpoints/chat.rb +168 -65
  161. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +40 -0
  162. data/lib/slack/web/api/endpoints/conversations.rb +182 -67
  163. data/lib/slack/web/api/endpoints/dialog.rb +5 -4
  164. data/lib/slack/web/api/endpoints/dnd.rb +9 -4
  165. data/lib/slack/web/api/endpoints/emoji.rb +1 -0
  166. data/lib/slack/web/api/endpoints/files.rb +69 -37
  167. data/lib/slack/web/api/endpoints/files_comments.rb +4 -36
  168. data/lib/slack/web/api/endpoints/files_remote.rb +127 -0
  169. data/lib/slack/web/api/endpoints/migration.rb +6 -3
  170. data/lib/slack/web/api/endpoints/oauth.rb +7 -31
  171. data/lib/slack/web/api/endpoints/oauth_v2.rb +48 -0
  172. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  173. data/lib/slack/web/api/endpoints/pins.rb +11 -18
  174. data/lib/slack/web/api/endpoints/reactions.rb +22 -21
  175. data/lib/slack/web/api/endpoints/reminders.rb +23 -10
  176. data/lib/slack/web/api/endpoints/rtm.rb +3 -25
  177. data/lib/slack/web/api/endpoints/search.rb +31 -16
  178. data/lib/slack/web/api/endpoints/stars.rb +14 -11
  179. data/lib/slack/web/api/endpoints/team.rb +15 -4
  180. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  181. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  182. data/lib/slack/web/api/endpoints/team_profile.rb +2 -1
  183. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  184. data/lib/slack/web/api/endpoints/usergroups.rb +31 -20
  185. data/lib/slack/web/api/endpoints/usergroups_users.rb +13 -8
  186. data/lib/slack/web/api/endpoints/users.rb +24 -23
  187. data/lib/slack/web/api/endpoints/users_admin.rb +3 -2
  188. data/lib/slack/web/api/endpoints/users_prefs.rb +1 -0
  189. data/lib/slack/web/api/endpoints/users_profile.rb +8 -7
  190. data/lib/slack/web/api/endpoints/views.rb +102 -0
  191. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  192. data/lib/slack/web/api/endpoints.rb +82 -18
  193. data/lib/slack/web/api/error.rb +1 -0
  194. data/lib/slack/web/api/errors/server_error.rb +37 -0
  195. data/lib/slack/web/api/errors/slack_error.rb +14 -1
  196. data/lib/slack/web/api/errors/too_many_requests_error.rb +2 -4
  197. data/lib/slack/web/api/errors.rb +1116 -0
  198. data/lib/slack/web/api/mixins/{channels.id.rb → conversations.id.rb} +5 -6
  199. data/lib/slack/web/api/mixins/ids.id.rb +3 -2
  200. data/lib/slack/web/api/mixins/users.id.rb +3 -4
  201. data/lib/slack/web/api/mixins/users.search.rb +3 -1
  202. data/lib/slack/web/api/mixins.rb +2 -2
  203. data/lib/slack/web/api/patches/chat.attachments-blocks.patch +69 -0
  204. data/lib/slack/web/api/patches/{dialog.1.open-json-support.patch → dialog.encoded-json.patch} +4 -4
  205. data/lib/slack/web/api/patches/views.view-json.patch +55 -0
  206. data/lib/slack/web/api/templates/command.erb +1 -0
  207. data/lib/slack/web/api/templates/commands.erb +1 -0
  208. data/lib/slack/web/api/templates/endpoints.erb +2 -2
  209. data/lib/slack/web/api/templates/errors.erb +20 -0
  210. data/lib/slack/web/api/templates/method.erb +6 -2
  211. data/lib/slack/web/api/templates/method_spec.erb +2 -1
  212. data/lib/slack/web/client.rb +2 -1
  213. data/lib/slack/web/config.rb +5 -2
  214. data/lib/slack/web/faraday/connection.rb +24 -20
  215. data/lib/slack/web/faraday/request.rb +5 -1
  216. data/lib/slack/web/faraday/response/raise_error.rb +14 -7
  217. data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
  218. data/lib/slack/web/pagination/cursor.rb +7 -7
  219. data/lib/slack-ruby-client.rb +12 -5
  220. data/lib/slack.rb +1 -0
  221. data/lib/slack_ruby_client.rb +1 -0
  222. data/lib/tasks/git.rake +1 -0
  223. data/lib/tasks/real_time.rake +51 -21
  224. data/lib/tasks/update.rake +1 -0
  225. data/lib/tasks/web.rake +48 -12
  226. data/screenshots/create-app.png +0 -0
  227. data/slack-ruby-client.gemspec +7 -12
  228. data/spec/fixtures/slack/web/429_error.yml +50 -54
  229. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  230. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  231. data/spec/fixtures/slack/web/conversations_info.yml +167 -0
  232. data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
  233. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
  234. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
  235. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  236. data/spec/fixtures/slack/web/rtm_connect.yml +347 -26
  237. data/spec/fixtures/slack/web/users_info.yml +153 -69
  238. data/spec/fixtures/slack/web/users_list.yml +102 -41
  239. data/spec/fixtures/slack/web/views_open_error.yml +83 -0
  240. data/spec/integration/integration_spec.rb +115 -47
  241. data/spec/slack/config_spec.rb +2 -0
  242. data/spec/slack/events/config_spec.rb +35 -0
  243. data/spec/slack/events/request_spec.rb +188 -0
  244. data/spec/slack/messages/formatting_spec.rb +35 -13
  245. data/spec/slack/real_time/api/message_spec.rb +7 -2
  246. data/spec/slack/real_time/api/ping_spec.rb +3 -1
  247. data/spec/slack/real_time/api/typing_spec.rb +6 -2
  248. data/spec/slack/real_time/client_spec.rb +300 -142
  249. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +2 -0
  250. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  251. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  252. data/spec/slack/real_time/event_handlers/bot_spec.rb +20 -17
  253. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +3 -2
  254. data/spec/slack/real_time/event_handlers/im_spec.rb +31 -27
  255. data/spec/slack/real_time/event_handlers/{group_spec.rb → private_channel_spec.rb} +36 -27
  256. data/spec/slack/real_time/event_handlers/{channel_spec.rb → public_channel_spec.rb} +31 -24
  257. data/spec/slack/real_time/event_handlers/team_spec.rb +8 -7
  258. data/spec/slack/real_time/event_handlers/user_spec.rb +7 -5
  259. data/spec/slack/real_time/rtm_connect_spec.rb +2 -1
  260. data/spec/slack/real_time/stores/store_spec.rb +50 -0
  261. data/spec/slack/slack_spec.rb +41 -6
  262. data/spec/slack/version_spec.rb +2 -1
  263. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  264. data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
  265. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +13 -0
  266. data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
  267. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +18 -0
  268. data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +8 -0
  269. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  270. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  271. data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +8 -0
  272. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  273. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +98 -0
  274. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
  275. data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
  276. data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
  277. data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
  278. data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
  279. data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
  280. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
  281. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
  282. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  283. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +41 -0
  284. data/spec/slack/web/api/endpoints/admin_users_spec.rb +67 -0
  285. data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
  286. data/spec/slack/web/api/endpoints/api_spec.rb +1 -0
  287. data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
  288. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  289. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  290. data/spec/slack/web/api/endpoints/apps_spec.rb +16 -0
  291. data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → auth_teams_spec.rb} +2 -1
  292. data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
  293. data/spec/slack/web/api/endpoints/bots_spec.rb +1 -0
  294. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  295. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  296. data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +8 -0
  297. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +9 -7
  298. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +144 -40
  299. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  300. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +18 -6
  301. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +8 -3
  302. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +112 -0
  303. data/spec/slack/web/api/endpoints/dnd_spec.rb +4 -3
  304. data/spec/slack/web/api/endpoints/emoji_spec.rb +1 -0
  305. data/spec/slack/web/api/endpoints/files_comments_spec.rb +3 -21
  306. data/spec/slack/web/api/endpoints/files_remote_spec.rb +24 -0
  307. data/spec/slack/web/api/endpoints/files_spec.rb +18 -4
  308. data/spec/slack/web/api/endpoints/migration_spec.rb +1 -0
  309. data/spec/slack/web/api/endpoints/oauth_spec.rb +1 -22
  310. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +16 -0
  311. data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
  312. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -0
  313. data/spec/slack/web/api/endpoints/reactions_spec.rb +8 -1
  314. data/spec/slack/web/api/endpoints/reminders_spec.rb +3 -2
  315. data/spec/slack/web/api/endpoints/rtm_spec.rb +1 -0
  316. data/spec/slack/web/api/endpoints/search_spec.rb +1 -0
  317. data/spec/slack/web/api/endpoints/stars_spec.rb +1 -0
  318. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → team_billing_spec.rb} +2 -1
  319. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
  320. data/spec/slack/web/api/endpoints/team_profile_spec.rb +1 -0
  321. data/spec/slack/web/api/endpoints/team_spec.rb +1 -0
  322. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  323. data/spec/slack/web/api/endpoints/usergroups_spec.rb +1 -0
  324. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +3 -2
  325. data/spec/slack/web/api/endpoints/users_admin_spec.rb +1 -0
  326. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +1 -0
  327. data/spec/slack/web/api/endpoints/users_profile_spec.rb +1 -0
  328. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  329. data/spec/slack/web/api/error_spec.rb +7 -7
  330. data/spec/slack/web/api/errors/slack_error_spec.rb +26 -7
  331. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  332. data/spec/slack/web/api/mixins/conversations_spec.rb +45 -0
  333. data/spec/slack/web/api/mixins/users_spec.rb +19 -8
  334. data/spec/slack/web/api/pagination/cursor_spec.rb +47 -15
  335. data/spec/slack/web/client_spec.rb +199 -22
  336. data/spec/slack/web/faraday/request_spec.rb +80 -0
  337. data/spec/slack/web/faraday/response/raise_error_spec.rb +48 -12
  338. data/spec/spec_helper.rb +9 -2
  339. data/spec/support/queue_with_timeout.rb +5 -4
  340. data/spec/support/real_time/concurrency/mock.rb +1 -0
  341. data/spec/support/real_time/connected_client.rb +6 -6
  342. data/spec/support/real_time/event.rb +1 -0
  343. data/spec/support/real_time/loaded_client.rb +120 -0
  344. data/spec/support/token.rb +1 -0
  345. data/spec/support/vcr.rb +37 -1
  346. metadata +174 -262
  347. data/.travis.yml +0 -32
  348. data/bin/commands/apps_permissions.rb +0 -22
  349. data/bin/commands/apps_permissions_resources.rb +0 -14
  350. data/bin/commands/apps_permissions_scopes.rb +0 -12
  351. data/bin/commands/apps_permissions_users.rb +0 -25
  352. data/bin/commands/channels.rb +0 -175
  353. data/bin/commands/groups.rb +0 -174
  354. data/bin/commands/im.rb +0 -67
  355. data/bin/commands/mpim.rb +0 -65
  356. data/examples/hi_real_time/Gemfile +0 -5
  357. data/examples/hi_real_time/hi.gif +0 -0
  358. data/examples/hi_real_time/hi.rb +0 -37
  359. data/examples/hi_real_time_async_celluloid/Gemfile +0 -6
  360. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  361. data/examples/hi_real_time_async_celluloid/hi.rb +0 -35
  362. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -6
  363. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  364. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -35
  365. data/lib/slack/real_time/concurrency/celluloid.rb +0 -118
  366. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -66
  367. data/lib/slack/web/api/endpoints/apps_permissions.rb +0 -35
  368. data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +0 -30
  369. data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +0 -20
  370. data/lib/slack/web/api/endpoints/apps_permissions_users.rb +0 -49
  371. data/lib/slack/web/api/endpoints/channels.rb +0 -266
  372. data/lib/slack/web/api/endpoints/groups.rb +0 -265
  373. data/lib/slack/web/api/endpoints/im.rb +0 -113
  374. data/lib/slack/web/api/endpoints/mpim.rb +0 -108
  375. data/lib/slack/web/api/endpoints/presence.rb +0 -23
  376. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  377. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  378. data/lib/slack/web/api/mixins/groups.id.rb +0 -26
  379. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  380. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  381. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  382. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  383. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -13
  384. data/screenshots/register-bot.png +0 -0
  385. data/spec/fixtures/slack/web/503_error.yml +0 -14
  386. data/spec/fixtures/slack/web/channels_info.yml +0 -46
  387. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  388. data/spec/fixtures/slack/web/rtm_start.yml +0 -104
  389. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -106
  390. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -47
  391. data/spec/slack/real_time/rtm_start_spec.rb +0 -13
  392. data/spec/slack/real_time/store_spec.rb +0 -11
  393. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -15
  394. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -18
  395. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -100
  396. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -11
  397. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -11
  398. data/spec/slack/web/api/endpoints/im_spec.rb +0 -38
  399. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -38
  400. data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -14
  401. data/spec/slack/web/api/mixins/channels_spec.rb +0 -33
  402. data/spec/slack/web/api/mixins/groups_spec.rb +0 -33
@@ -1,365 +1,350 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Slack
2
4
  module RealTime
3
5
  module Stores
4
- # Only stores initial information.
6
+ # Stores only basic team and self info
5
7
  class Starter < Base
6
- attr_reader :self
7
-
8
- attr_reader :team
8
+ attr_reader :self, :team
9
9
 
10
- def initialize(attrs)
10
+ def initialize(attrs, _options = {})
11
11
  @team = Models::Team.new(attrs.team)
12
- @self = Models::Team.new(attrs.self)
12
+ @self = Models::User.new(attrs.self)
13
13
  end
14
14
 
15
15
  ### RealTime Events
16
16
 
17
- # A private channel was deleted.
18
- # @see https://api.slack.com/events/group_deleted
19
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_deleted.json
20
- # on :group_deleted do |data|
21
-
22
- # Determine the current presence status for a list of users.
23
- # @see https://api.slack.com/events/presence_query
24
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/presence_query.json
25
- # on :presence_query do |data|
26
-
27
- # The membership of an existing User Group has changed.
28
- # @see https://api.slack.com/events/subteam_members_changed
29
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_members_changed.json
30
- # on :subteam_members_changed do |data|
31
-
32
- # Subscribe to presence events for the specified users.
33
- # @see https://api.slack.com/events/presence_sub
34
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/presence_sub.json
35
- # on :presence_sub do |data|
36
-
37
- # A user left a public or private channel.
38
- # @see https://api.slack.com/events/member_left_channel
39
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/member_left_channel.json
40
- # on :member_left_channel do |data|
17
+ # The list of accounts a user is signed into has changed.
18
+ # @see https://api.slack.com/events/accounts_changed
19
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/accounts_changed.json
20
+ # on :accounts_changed do |data|
41
21
 
42
- # A user joined a public or private channel.
43
- # @see https://api.slack.com/events/member_joined_channel
44
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/member_joined_channel.json
45
- # on :member_joined_channel do |data|
22
+ # A bot user was added.
23
+ # @see https://api.slack.com/events/bot_added
24
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/bot_added.json
25
+ # on :bot_added do |data|
46
26
 
47
- # The server intends to close the connection soon..
48
- # @see https://api.slack.com/events/goodbye
49
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/goodbye.json
50
- # on :goodbye do |data|
27
+ # A bot user was changed.
28
+ # @see https://api.slack.com/events/bot_changed
29
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/bot_changed.json
30
+ # on :bot_changed do |data|
51
31
 
52
- # Verifies ownership of an Events API Request URL.
53
- # @see https://api.slack.com/events/url_verification
54
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/url_verification.json
55
- # on :url_verification do |data|
32
+ # A channel was archived.
33
+ # @see https://api.slack.com/events/channel_archive
34
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_archive.json
35
+ # on :channel_archive do |data|
56
36
 
57
- # A message was posted in a multiparty direct message channel.
58
- # @see https://api.slack.com/events/message.mpim
59
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/message.mpim.json
60
- # on :message.mpim do |data|
37
+ # A channel was created.
38
+ # @see https://api.slack.com/events/channel_created
39
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_created.json
40
+ # on :channel_created do |data|
61
41
 
62
- # A message was posted in a direct message channel.
63
- # @see https://api.slack.com/events/message.im
64
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/message.im.json
65
- # on :message.im do |data|
42
+ # A channel was deleted.
43
+ # @see https://api.slack.com/events/channel_deleted
44
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_deleted.json
45
+ # on :channel_deleted do |data|
66
46
 
67
- # A message was posted to a private channel.
68
- # @see https://api.slack.com/events/message.groups
69
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/message.groups.json
70
- # on :message.groups do |data|
47
+ # Bulk updates were made to a channel's history.
48
+ # @see https://api.slack.com/events/channel_history_changed
49
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_history_changed.json
50
+ # on :channel_history_changed do |data|
71
51
 
72
- # A message was posted to a channel.
73
- # @see https://api.slack.com/events/message.channels
74
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/message.channels.json
75
- # on :message.channels do |data|
52
+ # You joined a channel.
53
+ # @see https://api.slack.com/events/channel_joined
54
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_joined.json
55
+ # on :channel_joined do |data|
76
56
 
77
- # A channel member is typing a message.
78
- # @see https://api.slack.com/events/user_typing
79
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/user_typing.json
80
- # on :user_typing do |data|
57
+ # You left a channel.
58
+ # @see https://api.slack.com/events/channel_left
59
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_left.json
60
+ # on :channel_left do |data|
81
61
 
82
- # A team member's data has changed.
83
- # @see https://api.slack.com/events/user_change
84
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/user_change.json
85
- # on :user_change do |data|
62
+ # Your channel read marker was updated.
63
+ # @see https://api.slack.com/events/channel_marked
64
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_marked.json
65
+ # on :channel_marked do |data|
86
66
 
87
- # A new team member has joined.
88
- # @see https://api.slack.com/events/team_join
89
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_join.json
90
- # on :team_join do |data|
67
+ # A channel was renamed.
68
+ # @see https://api.slack.com/events/channel_rename
69
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_rename.json
70
+ # on :channel_rename do |data|
91
71
 
92
- # An existing user group has been updated or its members changed.
93
- # @see https://api.slack.com/events/subteam_updated
94
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_updated.json
95
- # on :subteam_updated do |data|
72
+ # A channel was unarchived.
73
+ # @see https://api.slack.com/events/channel_unarchive
74
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_unarchive.json
75
+ # on :channel_unarchive do |data|
96
76
 
97
- # You have been removed from a user group.
98
- # @see https://api.slack.com/events/subteam_self_removed
99
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_self_removed.json
100
- # on :subteam_self_removed do |data|
77
+ # A slash command has been added or changed.
78
+ # @see https://api.slack.com/events/commands_changed
79
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/commands_changed.json
80
+ # on :commands_changed do |data|
101
81
 
102
- # You have been added to a user group.
103
- # @see https://api.slack.com/events/subteam_self_added
104
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_self_added.json
105
- # on :subteam_self_added do |data|
82
+ # Do not Disturb settings changed for the current user.
83
+ # @see https://api.slack.com/events/dnd_updated
84
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/dnd_updated.json
85
+ # on :dnd_updated do |data|
106
86
 
107
- # A user group has been added to the team.
108
- # @see https://api.slack.com/events/subteam_created
109
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_created.json
110
- # on :subteam_created do |data|
87
+ # Do not Disturb settings changed for a member.
88
+ # @see https://api.slack.com/events/dnd_updated_user
89
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/dnd_updated_user.json
90
+ # on :dnd_updated_user do |data|
111
91
 
112
- # A team member removed a star.
113
- # @see https://api.slack.com/events/star_removed
114
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_removed.json
115
- # on :star_removed do |data|
92
+ # The workspace email domain has changed.
93
+ # @see https://api.slack.com/events/email_domain_changed
94
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/email_domain_changed.json
95
+ on :email_domain_changed do |data|
96
+ team.email_domain = data.email_domain
97
+ end
116
98
 
117
- # A team member has starred an item.
118
- # @see https://api.slack.com/events/star_added
119
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_added.json
120
- # on :star_added do |data|
99
+ # A custom emoji has been added or changed.
100
+ # @see https://api.slack.com/events/emoji_changed
101
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/emoji_changed.json
102
+ # on :emoji_changed do |data|
121
103
 
122
- # Experimental.
123
- # @see https://api.slack.com/events/reconnect_url
124
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/reconnect_url.json
125
- # on :reconnect_url do |data|
104
+ # An enterprise grid migration has finished on an external workspace..
105
+ # @see https://api.slack.com/events/external_org_migration_finished
106
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/external_org_migration_finished.json
107
+ # on :external_org_migration_finished do |data|
126
108
 
127
- # A team member removed an emoji reaction.
128
- # @see https://api.slack.com/events/reaction_removed
129
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/reaction_removed.json
130
- # on :reaction_removed do |data|
109
+ # An enterprise grid migration has started on an external workspace..
110
+ # @see https://api.slack.com/events/external_org_migration_started
111
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/external_org_migration_started.json
112
+ # on :external_org_migration_started do |data|
131
113
 
132
- # A team member has added an emoji reaction to an item.
133
- # @see https://api.slack.com/events/reaction_added
134
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/reaction_added.json
135
- # on :reaction_added do |data|
114
+ # A file was changed.
115
+ # @see https://api.slack.com/events/file_change
116
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_change.json
117
+ # on :file_change do |data|
136
118
 
137
- # A team member's presence changed.
138
- # @see https://api.slack.com/events/presence_change
139
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/presence_change.json
140
- # on :presence_change do |data|
119
+ # A file comment was added.
120
+ # @see https://api.slack.com/events/file_comment_added
121
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_comment_added.json
122
+ # on :file_comment_added do |data|
141
123
 
142
- # You have updated your preferences.
143
- # @see https://api.slack.com/events/pref_change
144
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/pref_change.json
145
- # on :pref_change do |data|
124
+ # A file comment was deleted.
125
+ # @see https://api.slack.com/events/file_comment_deleted
126
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_comment_deleted.json
127
+ # on :file_comment_deleted do |data|
146
128
 
147
- # A pin was removed from a channel.
148
- # @see https://api.slack.com/events/pin_removed
149
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/pin_removed.json
150
- # on :pin_removed do |data|
129
+ # A file comment was edited.
130
+ # @see https://api.slack.com/events/file_comment_edited
131
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_comment_edited.json
132
+ # on :file_comment_edited do |data|
151
133
 
152
- # A pin was added to a channel.
153
- # @see https://api.slack.com/events/pin_added
154
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/pin_added.json
155
- # on :pin_added do |data|
134
+ # A file was created.
135
+ # @see https://api.slack.com/events/file_created
136
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_created.json
137
+ # on :file_created do |data|
156
138
 
157
- # You manually updated your presence.
158
- # @see https://api.slack.com/events/manual_presence_change
159
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/manual_presence_change.json
160
- # on :manual_presence_change do |data|
139
+ # A file was deleted.
140
+ # @see https://api.slack.com/events/file_deleted
141
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_deleted.json
142
+ # on :file_deleted do |data|
161
143
 
162
- # You opened a direct message channel.
163
- # @see https://api.slack.com/events/im_open
164
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_open.json
165
- # on :im_open do |data|
144
+ # A file was made public.
145
+ # @see https://api.slack.com/events/file_public
146
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_public.json
147
+ # on :file_public do |data|
166
148
 
167
- # A direct message read marker was updated.
168
- # @see https://api.slack.com/events/im_marked
169
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_marked.json
170
- # on :im_marked do |data|
149
+ # A file was shared.
150
+ # @see https://api.slack.com/events/file_shared
151
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_shared.json
152
+ # on :file_shared do |data|
171
153
 
172
- # Bulk updates were made to a DM channel's history.
173
- # @see https://api.slack.com/events/im_history_changed
174
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_history_changed.json
175
- # on :im_history_changed do |data|
154
+ # A file was unshared.
155
+ # @see https://api.slack.com/events/file_unshared
156
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_unshared.json
157
+ # on :file_unshared do |data|
176
158
 
177
- # A direct message channel was created.
178
- # @see https://api.slack.com/events/im_created
179
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_created.json
180
- # on :im_created do |data|
159
+ # The server intends to close the connection soon..
160
+ # @see https://api.slack.com/events/goodbye
161
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/goodbye.json
162
+ # on :goodbye do |data|
181
163
 
182
- # You closed a direct message channel.
183
- # @see https://api.slack.com/events/im_close
184
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_close.json
185
- # on :im_close do |data|
164
+ # A private channel was archived.
165
+ # @see https://api.slack.com/events/group_archive
166
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_archive.json
167
+ # on :group_archive do |data|
186
168
 
187
- # A private group was unarchived.
188
- # @see https://api.slack.com/events/group_unarchive
189
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_unarchive.json
190
- # on :group_unarchive do |data|
169
+ # You closed a private channel.
170
+ # @see https://api.slack.com/events/group_close
171
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_close.json
172
+ # on :group_close do |data|
191
173
 
192
- # A private group was renamed.
193
- # @see https://api.slack.com/events/group_rename
194
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_rename.json
195
- # on :group_rename do |data|
174
+ # A private channel was deleted.
175
+ # @see https://api.slack.com/events/group_deleted
176
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_deleted.json
177
+ # on :group_deleted do |data|
196
178
 
197
- # You opened a group channel.
198
- # @see https://api.slack.com/events/group_open
199
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_open.json
200
- # on :group_open do |data|
179
+ # Bulk updates were made to a private channel's history.
180
+ # @see https://api.slack.com/events/group_history_changed
181
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_history_changed.json
182
+ # on :group_history_changed do |data|
201
183
 
202
- # A private group read marker was updated.
203
- # @see https://api.slack.com/events/group_marked
204
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_marked.json
205
- # on :group_marked do |data|
184
+ # You joined a private channel.
185
+ # @see https://api.slack.com/events/group_joined
186
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_joined.json
187
+ # on :group_joined do |data|
206
188
 
207
- # You left a private group.
189
+ # You left a private channel.
208
190
  # @see https://api.slack.com/events/group_left
209
191
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_left.json
210
192
  # on :group_left do |data|
211
193
 
212
- # You joined a private group.
213
- # @see https://api.slack.com/events/group_joined
214
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_joined.json
215
- # on :group_joined do |data|
194
+ # A private channel read marker was updated.
195
+ # @see https://api.slack.com/events/group_marked
196
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_marked.json
197
+ # on :group_marked do |data|
216
198
 
217
- # Bulk updates were made to a group's history.
218
- # @see https://api.slack.com/events/group_history_changed
219
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_history_changed.json
220
- # on :group_history_changed do |data|
199
+ # You created a group DM.
200
+ # @see https://api.slack.com/events/group_open
201
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_open.json
202
+ # on :group_open do |data|
221
203
 
222
- # You closed a group channel.
223
- # @see https://api.slack.com/events/group_close
224
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_close.json
225
- # on :group_close do |data|
204
+ # A private channel was renamed.
205
+ # @see https://api.slack.com/events/group_rename
206
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_rename.json
207
+ # on :group_rename do |data|
226
208
 
227
- # A private group was archived.
228
- # @see https://api.slack.com/events/group_archive
229
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_archive.json
230
- # on :group_archive do |data|
209
+ # A private channel was unarchived.
210
+ # @see https://api.slack.com/events/group_unarchive
211
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/group_unarchive.json
212
+ # on :group_unarchive do |data|
231
213
 
232
- # A file was unshared.
233
- # @see https://api.slack.com/events/file_unshared
234
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_unshared.json
235
- # on :file_unshared do |data|
214
+ # The client has successfully connected to the server.
215
+ # @see https://api.slack.com/events/hello
216
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/hello.json
217
+ # on :hello do |data|
236
218
 
237
- # A file was shared.
238
- # @see https://api.slack.com/events/file_shared
239
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_shared.json
240
- # on :file_shared do |data|
219
+ # You closed a DM.
220
+ # @see https://api.slack.com/events/im_close
221
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_close.json
222
+ # on :im_close do |data|
241
223
 
242
- # A file was made public.
243
- # @see https://api.slack.com/events/file_public
244
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_public.json
245
- # on :file_public do |data|
224
+ # A DM was created.
225
+ # @see https://api.slack.com/events/im_created
226
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_created.json
227
+ # on :im_created do |data|
246
228
 
247
- # A file was made private.
248
- # @see https://api.slack.com/events/file_private
249
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_private.json
250
- # on :file_private do |data|
229
+ # Bulk updates were made to a DM's history.
230
+ # @see https://api.slack.com/events/im_history_changed
231
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_history_changed.json
232
+ # on :im_history_changed do |data|
251
233
 
252
- # A file was deleted.
253
- # @see https://api.slack.com/events/file_deleted
254
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_deleted.json
255
- # on :file_deleted do |data|
234
+ # A direct message read marker was updated.
235
+ # @see https://api.slack.com/events/im_marked
236
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_marked.json
237
+ # on :im_marked do |data|
256
238
 
257
- # A file was created.
258
- # @see https://api.slack.com/events/file_created
259
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_created.json
260
- # on :file_created do |data|
239
+ # You opened a DM.
240
+ # @see https://api.slack.com/events/im_open
241
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/im_open.json
242
+ # on :im_open do |data|
261
243
 
262
- # A file comment was edited.
263
- # @see https://api.slack.com/events/file_comment_edited
264
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_comment_edited.json
265
- # on :file_comment_edited do |data|
244
+ # You manually updated your presence.
245
+ # @see https://api.slack.com/events/manual_presence_change
246
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/manual_presence_change.json
247
+ # on :manual_presence_change do |data|
266
248
 
267
- # A file comment was deleted.
268
- # @see https://api.slack.com/events/file_comment_deleted
269
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_comment_deleted.json
270
- # on :file_comment_deleted do |data|
249
+ # A user joined a public channel, private channel or MPDM..
250
+ # @see https://api.slack.com/events/member_joined_channel
251
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/member_joined_channel.json
252
+ # on :member_joined_channel do |data|
271
253
 
272
- # A file comment was added.
273
- # @see https://api.slack.com/events/file_comment_added
274
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_comment_added.json
275
- # on :file_comment_added do |data|
254
+ # A user left a public or private channel.
255
+ # @see https://api.slack.com/events/member_left_channel
256
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/member_left_channel.json
257
+ # on :member_left_channel do |data|
276
258
 
277
- # A file was changed.
278
- # @see https://api.slack.com/events/file_change
279
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/file_change.json
280
- # on :file_change do |data|
259
+ # A pin was added to a channel.
260
+ # @see https://api.slack.com/events/pin_added
261
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/pin_added.json
262
+ # on :pin_added do |data|
281
263
 
282
- # A team custom emoji has been added or changed.
283
- # @see https://api.slack.com/events/emoji_changed
284
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/emoji_changed.json
285
- # on :emoji_changed do |data|
264
+ # A pin was removed from a channel.
265
+ # @see https://api.slack.com/events/pin_removed
266
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/pin_removed.json
267
+ # on :pin_removed do |data|
286
268
 
287
- # Do not Disturb settings changed for a team member.
288
- # @see https://api.slack.com/events/dnd_updated_user
289
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/dnd_updated_user.json
290
- # on :dnd_updated_user do |data|
269
+ # You have updated your preferences.
270
+ # @see https://api.slack.com/events/pref_change
271
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/pref_change.json
272
+ on :pref_change do |data|
273
+ self.self.prefs ||= {}
274
+ self.self.prefs[data.name] = data.value
275
+ end
291
276
 
292
- # Do not Disturb settings changed for the current user.
293
- # @see https://api.slack.com/events/dnd_updated
294
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/dnd_updated.json
295
- # on :dnd_updated do |data|
277
+ # A member's presence changed.
278
+ # @see https://api.slack.com/events/presence_change
279
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/presence_change.json
280
+ # on :presence_change do |data|
296
281
 
297
- # A team slash command has been added or changed.
298
- # @see https://api.slack.com/events/commands_changed
299
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/commands_changed.json
300
- # on :commands_changed do |data|
282
+ # Determine the current presence status for a list of users.
283
+ # @see https://api.slack.com/events/presence_query
284
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/presence_query.json
285
+ # on :presence_query do |data|
301
286
 
302
- # A team channel was unarchived.
303
- # @see https://api.slack.com/events/channel_unarchive
304
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_unarchive.json
305
- # on :channel_unarchive do |data|
287
+ # Subscribe to presence events for the specified users.
288
+ # @see https://api.slack.com/events/presence_sub
289
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/presence_sub.json
290
+ # on :presence_sub do |data|
306
291
 
307
- # A team channel was renamed.
308
- # @see https://api.slack.com/events/channel_rename
309
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_rename.json
310
- # on :channel_rename do |data|
292
+ # A member has added an emoji reaction to an item.
293
+ # @see https://api.slack.com/events/reaction_added
294
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/reaction_added.json
295
+ # on :reaction_added do |data|
311
296
 
312
- # Your channel read marker was updated.
313
- # @see https://api.slack.com/events/channel_marked
314
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_marked.json
315
- # on :channel_marked do |data|
297
+ # A member removed an emoji reaction.
298
+ # @see https://api.slack.com/events/reaction_removed
299
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/reaction_removed.json
300
+ # on :reaction_removed do |data|
316
301
 
317
- # You left a channel.
318
- # @see https://api.slack.com/events/channel_left
319
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_left.json
320
- # on :channel_left do |data|
302
+ # Experimental.
303
+ # @see https://api.slack.com/events/reconnect_url
304
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/reconnect_url.json
305
+ # on :reconnect_url do |data|
321
306
 
322
- # You joined a channel.
323
- # @see https://api.slack.com/events/channel_joined
324
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_joined.json
325
- # on :channel_joined do |data|
307
+ # A shared channel invite was sent to a Slack user.
308
+ # @see https://api.slack.com/events/shared_channel_invite_received
309
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/shared_channel_invite_received.json
310
+ # on :shared_channel_invite_received do |data|
326
311
 
327
- # Bulk updates were made to a channel's history.
328
- # @see https://api.slack.com/events/channel_history_changed
329
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_history_changed.json
330
- # on :channel_history_changed do |data|
312
+ # A member has starred an item.
313
+ # @see https://api.slack.com/events/star_added
314
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_added.json
315
+ # on :star_added do |data|
331
316
 
332
- # A team channel was deleted.
333
- # @see https://api.slack.com/events/channel_deleted
334
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_deleted.json
335
- # on :channel_deleted do |data|
317
+ # A member removed a star.
318
+ # @see https://api.slack.com/events/star_removed
319
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/star_removed.json
320
+ # on :star_removed do |data|
336
321
 
337
- # A team channel was created.
338
- # @see https://api.slack.com/events/channel_created
339
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_created.json
340
- # on :channel_created do |data|
322
+ # A User Group has been added to the workspace.
323
+ # @see https://api.slack.com/events/subteam_created
324
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_created.json
325
+ # on :subteam_created do |data|
341
326
 
342
- # A team channel was archived.
343
- # @see https://api.slack.com/events/channel_archive
344
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/channel_archive.json
345
- # on :channel_archive do |data|
327
+ # The membership of an existing User Group has changed.
328
+ # @see https://api.slack.com/events/subteam_members_changed
329
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_members_changed.json
330
+ # on :subteam_members_changed do |data|
346
331
 
347
- # An integration bot was changed.
348
- # @see https://api.slack.com/events/bot_changed
349
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/bot_changed.json
350
- # on :bot_changed do |data|
332
+ # You have been added to a User Group.
333
+ # @see https://api.slack.com/events/subteam_self_added
334
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_self_added.json
335
+ # on :subteam_self_added do |data|
351
336
 
352
- # An integration bot was added.
353
- # @see https://api.slack.com/events/bot_added
354
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/bot_added.json
355
- # on :bot_added do |data|
337
+ # You have been removed from a User Group.
338
+ # @see https://api.slack.com/events/subteam_self_removed
339
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_self_removed.json
340
+ # on :subteam_self_removed do |data|
356
341
 
357
- # The list of accounts a user is signed into has changed.
358
- # @see https://api.slack.com/events/accounts_changed
359
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/accounts_changed.json
360
- # on :accounts_changed do |data|
342
+ # An existing User Group has been updated or its members changed.
343
+ # @see https://api.slack.com/events/subteam_updated
344
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/subteam_updated.json
345
+ # on :subteam_updated do |data|
361
346
 
362
- # The team domain has changed.
347
+ # The workspace domain has changed.
363
348
  # @see https://api.slack.com/events/team_domain_change
364
349
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_domain_change.json
365
350
  on :team_domain_change do |data|
@@ -367,19 +352,24 @@ module Slack
367
352
  team.domain = data.domain
368
353
  end
369
354
 
370
- # The team is being migrated between servers.
355
+ # A new member has joined.
356
+ # @see https://api.slack.com/events/team_join
357
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_join.json
358
+ # on :team_join do |data|
359
+
360
+ # The workspace is being migrated between servers.
371
361
  # @see https://api.slack.com/events/team_migration_started
372
362
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_migration_started.json
373
363
  # on :team_migration_started do |data|
374
364
 
375
- # The team billing plan has changed.
365
+ # The account billing plan has changed.
376
366
  # @see https://api.slack.com/events/team_plan_change
377
367
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_plan_change.json
378
368
  on :team_plan_change do |data|
379
369
  team.plan = data.plan
380
370
  end
381
371
 
382
- # A team preference has been updated.
372
+ # A preference has been updated.
383
373
  # @see https://api.slack.com/events/team_pref_change
384
374
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_pref_change.json
385
375
  on :team_pref_change do |data|
@@ -387,34 +377,72 @@ module Slack
387
377
  team.prefs[data.name] = data.value
388
378
  end
389
379
 
390
- # Team profile fields have been updated.
380
+ # The workspace profile fields have been updated.
391
381
  # @see https://api.slack.com/events/team_profile_change
392
382
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_profile_change.json
393
383
  # on :team_profile_change do |data|
394
384
 
395
- # Team profile fields have been deleted.
385
+ # The workspace profile fields have been deleted.
396
386
  # @see https://api.slack.com/events/team_profile_delete
397
387
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_profile_delete.json
398
388
  # on :team_profile_delete do |data|
399
389
 
400
- # Team profile fields have been reordered.
390
+ # The workspace profile fields have been reordered.
401
391
  # @see https://api.slack.com/events/team_profile_reorder
402
392
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_profile_reorder.json
403
393
  # on :team_profile_reorder do |data|
404
394
 
405
- # The team name has changed.
395
+ # The workspace name has changed.
406
396
  # @see https://api.slack.com/events/team_rename
407
397
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/team_rename.json
408
398
  on :team_rename do |data|
409
399
  team.name = data.name
410
400
  end
411
401
 
412
- # The team email domain has changed.
413
- # @see https://api.slack.com/events/email_domain_changed
414
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/email_domain_changed.json
415
- on :email_domain_changed do |data|
416
- team.email_domain = data.email_domain
417
- end
402
+ # A member's data has changed.
403
+ # @see https://api.slack.com/events/user_change
404
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/user_change.json
405
+ # on :user_change do |data|
406
+
407
+ # A user's huddle status has changed.
408
+ # @see https://api.slack.com/events/user_huddle_changed
409
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/user_huddle_changed.json
410
+ # on :user_huddle_changed do |data|
411
+
412
+ # A user's profile data has changed.
413
+ # @see https://api.slack.com/events/user_profile_changed
414
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/user_profile_changed.json
415
+ # on :user_profile_changed do |data|
416
+
417
+ # A user's status has changed.
418
+ # @see https://api.slack.com/events/user_status_changed
419
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/user_status_changed.json
420
+ # on :user_status_changed do |data|
421
+
422
+ # A channel member is typing a message.
423
+ # @see https://api.slack.com/events/user_typing
424
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/user_typing.json
425
+ # on :user_typing do |data|
426
+
427
+ # A message was posted in a multiparty direct message channel.
428
+ # @see https://api.slack.com/events/message.mpim
429
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/message.mpim.json
430
+ # on :message.mpim do |data|
431
+
432
+ # A message was posted in a direct message channel.
433
+ # @see https://api.slack.com/events/message.im
434
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/message.im.json
435
+ # on :message.im do |data|
436
+
437
+ # A message was posted to a private channel.
438
+ # @see https://api.slack.com/events/message.groups
439
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/message.groups.json
440
+ # on :message.groups do |data|
441
+
442
+ # A message was posted to a channel.
443
+ # @see https://api.slack.com/events/message.channels
444
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/events/message.channels.json
445
+ # on :message.channels do |data|
418
446
  end
419
447
  end
420
448
  end