slack-ruby-client 0.14.6 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (274) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +15 -3
  4. data/.rubocop_todo.yml +110 -38
  5. data/.travis.yml +2 -5
  6. data/CHANGELOG.md +42 -0
  7. data/CONTRIBUTING.md +19 -8
  8. data/Dangerfile +1 -1
  9. data/Gemfile +1 -2
  10. data/LICENSE.md +1 -1
  11. data/README.md +38 -36
  12. data/RELEASING.md +1 -1
  13. data/UPGRADING.md +62 -2
  14. data/bin/commands/admin_analytics.rb +16 -0
  15. data/bin/commands/admin_apps.rb +26 -2
  16. data/bin/commands/admin_apps_requests.rb +1 -0
  17. data/bin/commands/admin_auth_policy.rb +39 -0
  18. data/bin/commands/admin_barriers.rb +47 -0
  19. data/bin/commands/admin_conversations.rb +155 -3
  20. data/bin/commands/admin_conversations_ekm.rb +17 -0
  21. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  22. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  23. data/bin/commands/admin_emoji.rb +1 -1
  24. data/bin/commands/admin_teams.rb +1 -1
  25. data/bin/commands/admin_usergroups.rb +48 -0
  26. data/bin/commands/admin_users.rb +3 -2
  27. data/bin/commands/admin_users_session.rb +62 -0
  28. data/bin/commands/api.rb +0 -1
  29. data/bin/commands/apps_connections.rb +13 -0
  30. data/bin/commands/apps_event_authorizations.rb +16 -0
  31. data/bin/commands/apps_manifest.rb +51 -0
  32. data/bin/commands/auth_teams.rb +16 -0
  33. data/bin/commands/bots.rb +1 -0
  34. data/bin/commands/calls.rb +52 -0
  35. data/bin/commands/calls_participants.rb +25 -0
  36. data/bin/commands/channels.rb +1 -155
  37. data/bin/commands/chat.rb +17 -12
  38. data/bin/commands/chat_scheduledMessages.rb +1 -0
  39. data/bin/commands/conversations.rb +71 -3
  40. data/bin/commands/dnd.rb +2 -0
  41. data/bin/commands/files.rb +6 -4
  42. data/bin/commands/files_remote.rb +2 -2
  43. data/bin/commands/groups.rb +1 -162
  44. data/bin/commands/im.rb +1 -63
  45. data/bin/commands/migration.rb +1 -0
  46. data/bin/commands/mpim.rb +1 -61
  47. data/bin/commands/oauth.rb +0 -13
  48. data/bin/commands/oauth_v2.rb +13 -1
  49. data/bin/commands/openid_connect.rb +27 -0
  50. data/bin/commands/pins.rb +2 -4
  51. data/bin/commands/reactions.rb +1 -0
  52. data/bin/commands/reminders.rb +6 -0
  53. data/bin/commands/rtm.rb +2 -2
  54. data/bin/commands/search.rb +4 -0
  55. data/bin/commands/stars.rb +7 -6
  56. data/bin/commands/team.rb +3 -0
  57. data/bin/commands/team_billing.rb +13 -0
  58. data/bin/commands/team_preferences.rb +13 -0
  59. data/bin/commands/tooling_tokens.rb +14 -0
  60. data/bin/commands/usergroups.rb +5 -0
  61. data/bin/commands/usergroups_users.rb +2 -0
  62. data/bin/commands/users.rb +4 -2
  63. data/bin/commands/users_profile.rb +5 -5
  64. data/bin/commands/views.rb +2 -2
  65. data/bin/commands/workflows.rb +38 -0
  66. data/bin/commands.rb +17 -8
  67. data/lib/slack/config.rb +1 -2
  68. data/lib/slack/events/request.rb +10 -4
  69. data/lib/slack/messages/message.rb +0 -4
  70. data/lib/slack/real_time/client.rb +6 -6
  71. data/lib/slack/real_time/concurrency/async.rb +7 -11
  72. data/lib/slack/real_time/concurrency.rb +0 -2
  73. data/lib/slack/real_time/config.rb +5 -14
  74. data/lib/slack/real_time/models/base.rb +0 -4
  75. data/lib/slack/real_time/socket.rb +3 -4
  76. data/lib/slack/real_time/stores/base.rb +4 -7
  77. data/lib/slack/real_time/stores/starter.rb +6 -3
  78. data/lib/slack/real_time/stores/store.rb +5 -0
  79. data/lib/slack/version.rb +1 -1
  80. data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
  81. data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
  82. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  83. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
  84. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  85. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  86. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  87. data/lib/slack/web/api/endpoints/admin_conversations.rb +234 -4
  88. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  89. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  90. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  91. data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
  92. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  93. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  94. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  95. data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
  96. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  97. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  98. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  99. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  100. data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
  101. data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
  102. data/lib/slack/web/api/endpoints/api.rb +1 -3
  103. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  104. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  105. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  106. data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
  107. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  108. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  109. data/lib/slack/web/api/endpoints/bots.rb +3 -1
  110. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  111. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  112. data/lib/slack/web/api/endpoints/channels.rb +1 -245
  113. data/lib/slack/web/api/endpoints/chat.rb +76 -66
  114. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +5 -3
  115. data/lib/slack/web/api/endpoints/conversations.rb +149 -41
  116. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  117. data/lib/slack/web/api/endpoints/dnd.rb +6 -3
  118. data/lib/slack/web/api/endpoints/files.rb +21 -17
  119. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  120. data/lib/slack/web/api/endpoints/files_remote.rb +23 -23
  121. data/lib/slack/web/api/endpoints/groups.rb +0 -253
  122. data/lib/slack/web/api/endpoints/im.rb +0 -101
  123. data/lib/slack/web/api/endpoints/migration.rb +4 -2
  124. data/lib/slack/web/api/endpoints/mpim.rb +0 -96
  125. data/lib/slack/web/api/endpoints/oauth.rb +5 -30
  126. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  127. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  128. data/lib/slack/web/api/endpoints/pins.rb +7 -12
  129. data/lib/slack/web/api/endpoints/reactions.rb +16 -14
  130. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  131. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  132. data/lib/slack/web/api/endpoints/search.rb +27 -13
  133. data/lib/slack/web/api/endpoints/stars.rb +13 -11
  134. data/lib/slack/web/api/endpoints/team.rb +11 -5
  135. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  136. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  137. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  138. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  139. data/lib/slack/web/api/endpoints/usergroups.rb +26 -16
  140. data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
  141. data/lib/slack/web/api/endpoints/users.rb +20 -18
  142. data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
  143. data/lib/slack/web/api/endpoints/views.rb +13 -13
  144. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  145. data/lib/slack/web/api/endpoints.rb +35 -18
  146. data/lib/slack/web/api/errors/server_error.rb +37 -0
  147. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  148. data/lib/slack/web/api/errors.rb +486 -12
  149. data/lib/slack/web/api/mixins/{channels.id.rb → conversations.id.rb} +3 -5
  150. data/lib/slack/web/api/mixins/ids.id.rb +3 -5
  151. data/lib/slack/web/api/mixins/users.id.rb +1 -3
  152. data/lib/slack/web/api/mixins.rb +1 -2
  153. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +25 -24
  154. data/lib/slack/web/api/templates/endpoints.erb +1 -2
  155. data/lib/slack/web/api/templates/method.erb +4 -1
  156. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  157. data/lib/slack/web/config.rb +2 -0
  158. data/lib/slack/web/faraday/connection.rb +23 -20
  159. data/lib/slack/web/faraday/request.rb +2 -1
  160. data/lib/slack/web/faraday/response/raise_error.rb +12 -1
  161. data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
  162. data/lib/slack/web/pagination/cursor.rb +3 -7
  163. data/lib/slack-ruby-client.rb +4 -4
  164. data/lib/tasks/web.rake +11 -3
  165. data/slack-ruby-client.gemspec +6 -7
  166. data/spec/fixtures/slack/web/429_error.yml +50 -54
  167. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  168. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  169. data/spec/fixtures/slack/web/conversations_info.yml +167 -0
  170. data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
  171. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
  172. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
  173. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  174. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  175. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  176. data/spec/fixtures/slack/web/users_info.yml +153 -69
  177. data/spec/fixtures/slack/web/users_list.yml +102 -41
  178. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  179. data/spec/slack/events/request_spec.rb +13 -8
  180. data/spec/slack/real_time/client_spec.rb +35 -22
  181. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  182. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  183. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  184. data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
  185. data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
  186. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  187. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  188. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  189. data/spec/slack/slack_spec.rb +3 -1
  190. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  191. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
  192. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  193. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  194. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
  195. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  196. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
  197. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
  198. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
  199. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
  200. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  201. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
  202. data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
  203. data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
  204. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  205. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  206. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  207. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
  208. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  209. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  210. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  211. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  212. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  213. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  214. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  215. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  216. data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
  217. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -22
  218. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  219. data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
  220. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
  221. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  222. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  223. data/spec/slack/web/api/endpoints/team_billing_spec.rb +8 -0
  224. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
  225. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  226. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  227. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  228. data/spec/slack/web/api/error_spec.rb +5 -7
  229. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  230. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  231. data/spec/slack/web/api/mixins/{channels_spec.rb → conversations_spec.rb} +8 -8
  232. data/spec/slack/web/api/mixins/users_spec.rb +1 -1
  233. data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
  234. data/spec/slack/web/client_spec.rb +123 -1
  235. data/spec/slack/web/faraday/request_spec.rb +80 -0
  236. data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
  237. data/spec/spec_helper.rb +1 -1
  238. data/spec/support/real_time/connected_client.rb +1 -7
  239. data/spec/support/vcr.rb +36 -1
  240. metadata +95 -173
  241. data/examples/hi_real_time/Gemfile +0 -6
  242. data/examples/hi_real_time/hi.gif +0 -0
  243. data/examples/hi_real_time/hi.rb +0 -41
  244. data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
  245. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  246. data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
  247. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
  248. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  249. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
  250. data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
  251. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
  252. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  253. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  254. data/lib/slack/web/api/mixins/groups.id.rb +0 -27
  255. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  256. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  257. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  258. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  259. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
  260. data/spec/fixtures/slack/web/503_error.yml +0 -14
  261. data/spec/fixtures/slack/web/channels_info.yml +0 -46
  262. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  263. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
  264. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
  265. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  266. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  267. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -101
  268. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
  269. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
  270. data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
  271. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
  272. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
  273. data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
  274. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24883016f639f51e34aa4026ff203ef1cb6fa66abac9c0017d5653508f9169c7
4
- data.tar.gz: 49bf4585f49dba526c764e018150ed9e884161c67529e442ef9e5df104d48345
3
+ metadata.gz: 5fa18d8339ff27661d942ef4d0cee003ff8e1146db504063a736374c5f5bf940
4
+ data.tar.gz: fc3bca990c3ad938a23db950b2008932a29518363360ada378856e71f2c1b477
5
5
  SHA512:
6
- metadata.gz: db889eac4fbc7effec2f2f8bd319523f4e3c646ad0be8b52e2221a444d79cca38bae6fed8d0b6aac100c4869f862f6cfddb4644407d305977ad8b2a3fc1da670
7
- data.tar.gz: 636f316d2e9efba1f663ccf0691fcf715b4f6a16d80bb98d8e5676d5479d6536beaa9a5c4de0452319a166ef50f9c7e6cddf451e6898600b3a57897b862472d2
6
+ metadata.gz: 932b6be224f16a7873a24907074944eea9ac8fcb47e35f7f9ef876d11df396197771c44727738b63267e4da45cd5c2050084972844a76fa6134fc54e2a9aa0d6
7
+ data.tar.gz: 8a5904155cd7b3d52fbeca8c9a0887bca7eabe4bb4b668174aa4accb5cfefb7784ec91f3e3d9182fef44d6a994168b72c4530c36a74cf2d7564eec6a0e204ea5
@@ -0,0 +1 @@
1
+ github: [dblock]
data/.rubocop.yml CHANGED
@@ -5,6 +5,8 @@ require:
5
5
  - rubocop-rspec
6
6
 
7
7
  AllCops:
8
+ TargetRubyVersion: 2.5
9
+ NewCops: enable
8
10
  DisplayCopNames: true
9
11
  Exclude:
10
12
  - bin/**/*
@@ -13,18 +15,28 @@ AllCops:
13
15
  - lib/slack/web/api/endpoints/* # Auto-generated
14
16
  - lib/slack/web/api/errors.rb # Auto-generated
15
17
  - spec/slack/web/api/endpoints/* # Auto-generated
18
+
16
19
  Layout/EmptyLineAfterMagicComment:
17
20
  Enabled: false
21
+
18
22
  Metrics/BlockLength:
19
- Max: 250
23
+ Enabled: false
24
+
20
25
  Metrics/ClassLength:
21
26
  Max: 250
22
- Metrics/LineLength:
23
- Max: 100
27
+
28
+ Layout/LineLength:
29
+ Max: 128
30
+
24
31
  Style/Documentation:
25
32
  Enabled: false
33
+
26
34
  Style/ModuleFunction:
27
35
  Enabled: false
36
+
37
+ RSpec/InstanceVariable:
38
+ Enabled: false
39
+
28
40
  Naming/FileName:
29
41
  Exclude:
30
42
  - lib/slack-ruby-client.rb # Required to match gemspec name
data/.rubocop_todo.yml CHANGED
@@ -1,94 +1,166 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-12-23 15:50:03 -0500 using RuboCop version 0.73.0.
3
+ # on 2021-12-21 14:31:33 UTC using RuboCop version 0.93.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 3
10
- # Configuration parameters: AllowComments.
11
- Lint/HandleExceptions:
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
12
13
  Exclude:
13
- - 'lib/slack/real_time/concurrency/async.rb'
14
- - 'spec/slack/real_time/concurrency/celluloid_spec.rb'
15
- - 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
14
+ - 'slack-ruby-client.gemspec'
16
15
 
17
- # Offense count: 10
18
- Metrics/AbcSize:
19
- Max: 39
16
+ # Offense count: 1
17
+ Lint/ConstantDefinitionInBlock:
18
+ Exclude:
19
+ - 'lib/tasks/real_time.rake'
20
+
21
+ # Offense count: 2
22
+ Lint/MissingSuper:
23
+ Exclude:
24
+ - 'lib/slack/real_time/stores/starter.rb'
25
+ - 'lib/slack/real_time/stores/store.rb'
20
26
 
21
27
  # Offense count: 1
28
+ # Cop supports --auto-correct.
29
+ Lint/NonDeterministicRequireOrder:
30
+ Exclude:
31
+ - 'spec/spec_helper.rb'
32
+
33
+ # Offense count: 2
34
+ # Cop supports --auto-correct.
35
+ Lint/RedundantCopDisableDirective:
36
+ Exclude:
37
+ - 'lib/slack-ruby-client.rb'
38
+
39
+ # Offense count: 12
40
+ # Configuration parameters: IgnoredMethods.
41
+ Metrics/AbcSize:
42
+ Max: 48
43
+
44
+ # Offense count: 4
45
+ # Configuration parameters: IgnoredMethods.
22
46
  Metrics/CyclomaticComplexity:
23
- Max: 9
47
+ Max: 14
24
48
 
25
- # Offense count: 14
26
- # Configuration parameters: CountComments, ExcludedMethods.
49
+ # Offense count: 12
50
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
27
51
  Metrics/MethodLength:
28
52
  Max: 32
29
53
 
30
54
  # Offense count: 1
55
+ # Configuration parameters: CountKeywordArgs.
56
+ Metrics/ParameterLists:
57
+ Max: 6
58
+
59
+ # Offense count: 2
60
+ # Configuration parameters: IgnoredMethods.
31
61
  Metrics/PerceivedComplexity:
32
- Max: 9
62
+ Max: 16
33
63
 
34
- # Offense count: 1
35
- RSpec/AnyInstance:
64
+ # Offense count: 2
65
+ # Cop supports --auto-correct.
66
+ Performance/RegexpMatch:
36
67
  Exclude:
37
- - 'spec/slack/real_time/concurrency/celluloid_spec.rb'
68
+ - 'lib/tasks/web.rake'
38
69
 
39
- # Offense count: 70
70
+ # Offense count: 3
71
+ # Cop supports --auto-correct.
72
+ RSpec/ContextMethod:
73
+ Exclude:
74
+ - 'spec/slack/messages/formatting_spec.rb'
75
+ - 'spec/slack/web/api/mixins/users_spec.rb'
76
+
77
+ # Offense count: 77
40
78
  # Configuration parameters: Prefixes.
41
79
  # Prefixes: when, with, without
42
80
  RSpec/ContextWording:
43
81
  Enabled: false
44
82
 
45
- # Offense count: 64
83
+ # Offense count: 127
84
+ # Cop supports --auto-correct.
85
+ # Configuration parameters: AllowConsecutiveOneLiners.
86
+ RSpec/EmptyLineAfterExample:
87
+ Enabled: false
88
+
89
+ # Offense count: 62
46
90
  # Configuration parameters: Max.
47
91
  RSpec/ExampleLength:
48
92
  Enabled: false
49
93
 
50
- # Offense count: 17
94
+ # Offense count: 16
51
95
  # Configuration parameters: CustomTransform, IgnoreMethods.
52
96
  RSpec/FilePath:
53
97
  Enabled: false
54
98
 
55
- # Offense count: 13
56
- # Configuration parameters: AssignmentOnly.
57
- RSpec/InstanceVariable:
58
- Exclude:
59
- - 'spec/integration/integration_spec.rb'
60
- - 'spec/slack/real_time/client_spec.rb'
61
- - 'spec/slack/slack_spec.rb'
62
-
63
- # Offense count: 75
99
+ # Offense count: 65
64
100
  # Configuration parameters: .
65
101
  # SupportedStyles: have_received, receive
66
102
  RSpec/MessageSpies:
67
103
  EnforcedStyle: receive
68
104
 
69
- # Offense count: 93
70
- # Configuration parameters: AggregateFailuresByDefault.
105
+ # Offense count: 95
71
106
  RSpec/MultipleExpectations:
72
107
  Max: 5
73
108
 
74
- # Offense count: 34
109
+ # Offense count: 3
110
+ # Configuration parameters: IgnoreSharedExamples.
111
+ RSpec/NamedSubject:
112
+ Exclude:
113
+ - 'spec/slack/web/api/mixins/conversations_list_spec.rb'
114
+
115
+ # Offense count: 48
75
116
  RSpec/NestedGroups:
76
117
  Max: 6
77
118
 
78
- # Offense count: 3
119
+ # Offense count: 2
79
120
  RSpec/SubjectStub:
80
121
  Exclude:
81
- - 'spec/slack/web/api/mixins/channels_spec.rb'
82
- - 'spec/slack/web/api/mixins/groups_spec.rb'
122
+ - 'spec/slack/web/api/mixins/conversations_spec.rb'
83
123
  - 'spec/slack/web/api/mixins/users_spec.rb'
84
124
 
85
- # Offense count: 16
125
+ # Offense count: 12
86
126
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
87
127
  RSpec/VerifiedDoubles:
88
128
  Exclude:
89
129
  - 'spec/slack/events/request_spec.rb'
90
130
  - 'spec/slack/real_time/client_spec.rb'
91
- - 'spec/slack/real_time/concurrency/celluloid_spec.rb'
92
- - 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
93
131
  - 'spec/slack/web/faraday/response/raise_error_spec.rb'
94
132
  - 'spec/support/real_time/connected_client.rb'
133
+
134
+ # Offense count: 4
135
+ # Configuration parameters: .
136
+ # SupportedStyles: annotated, template, unannotated
137
+ Style/FormatStringToken:
138
+ EnforcedStyle: unannotated
139
+
140
+ # Offense count: 6
141
+ # Cop supports --auto-correct.
142
+ Style/GlobalStdStream:
143
+ Exclude:
144
+ - 'lib/slack/logger.rb'
145
+ - 'lib/tasks/real_time.rake'
146
+ - 'spec/integration/integration_spec.rb'
147
+ - 'spec/slack/web/client_spec.rb'
148
+
149
+ # Offense count: 1
150
+ # Cop supports --auto-correct.
151
+ Style/MultilineTernaryOperator:
152
+ Exclude:
153
+ - 'spec/support/vcr.rb'
154
+
155
+ # Offense count: 1
156
+ # Configuration parameters: AllowedMethods.
157
+ # AllowedMethods: respond_to_missing?
158
+ Style/OptionalBooleanParameter:
159
+ Exclude:
160
+ - 'spec/support/queue_with_timeout.rb'
161
+
162
+ # Offense count: 1
163
+ # Cop supports --auto-correct.
164
+ Style/StringConcatenation:
165
+ Exclude:
166
+ - 'lib/tasks/real_time.rake'
data/.travis.yml CHANGED
@@ -3,9 +3,10 @@ language: ruby
3
3
  cache: bundler
4
4
 
5
5
  rvm:
6
- - 2.3.8
7
6
  - 2.5.3
8
7
  - 2.6.0
8
+ - 2.7.1
9
+ - 3.0.2
9
10
  - ruby-head
10
11
  - jruby-head
11
12
 
@@ -14,10 +15,6 @@ matrix:
14
15
  - rvm: 2.4.1
15
16
  script:
16
17
  - bundle exec danger
17
- - rvm: 2.4.1
18
- env: CONCURRENCY=celluloid-io
19
- - rvm: 2.4.1
20
- env: CONCURRENCY=faye-websocket
21
18
  - rvm: 2.5.3
22
19
  env: CONCURRENCY=async-websocket
23
20
  allow_failures:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,45 @@
1
+ ### 1.0.0 (2021/12/21)
2
+
3
+ * [#394](https://github.com/slack-ruby/slack-ruby-client/pull/394): Added support for Ruby 3.0 - [@dblock](https://github.com/dblock).
4
+ * [#394](https://github.com/slack-ruby/slack-ruby-client/pull/394): Upgraded to RuboCop 0.93.1 - [@dblock](https://github.com/dblock).
5
+ * [#393](https://github.com/slack-ruby/slack-ruby-client/pull/393): Removed deprecated `oauth_token`, and leftover traces of `channels` and `groups` APIs - [@dblock](https://github.com/dblock).
6
+ * [#393](https://github.com/slack-ruby/slack-ruby-client/pull/393): Added `admin_auth_policy_assignEntities`, `admin_auth_policy_getEntities` and `admin_auth_policy_removeEntities` `admin_conversations_disconnectShared`, `admin_users_session_clearSettings`, `admin_users_session_getSettings`, `admin_users_session_resetBulk`, `admin_users_session_setSettings`, `apps_manifest_create`, `apps_manifest_delete`, `apps_manifest_export`, `apps_manifest_update`, `apps_manifest_validate`, `conversations_acceptSharedInvite`, `conversations_approveSharedInvite`, `conversations_declineSharedInvite`, `conversations_inviteShared`, `conversations_listConnectInvites`, `oauth_v2_exchange`, `openid_connect_token`, `openid_connect_userInfo`, `team_billing_info`, `team_preferences_list`, `tooling_tokens_rotate` - [@dblock](https://github.com/dblock).
7
+ * [#386](https://github.com/slack-ruby/slack-ruby-client/pull/386): Gemspec: drop unused `test_files` directive - [@olleolleolle](https://github.com/olleolleolle).
8
+ * [#380](https://github.com/slack-ruby/slack-ruby-client/pull/380): Updates to server error classes and hierarchy - [@jmanian](https://github.com/jmanian).
9
+ * [#387](https://github.com/slack-ruby/slack-ruby-client/pull/387): Send token in Authorization header - [@chrisbloom7](https://github.com/chrisbloom7).
10
+
11
+ ### 0.17.0 (2021/03/07)
12
+
13
+ * [#370](https://github.com/slack-ruby/slack-ruby-client/pull/370): Removed deprecated `im_`, `mpim_`, `channels_`, and `groups_` methods - [@dblock](https://github.com/dblock).
14
+ * [#368](https://github.com/slack-ruby/slack-ruby-client/pull/368): Removed `admin_conversations_whitelist` and `admin_conversations_disconnectShared` - [@dblock](https://github.com/dblock).
15
+ * [#359](https://github.com/slack-ruby/slack-ruby-client/pull/359): Handle non-JSON 500 errors - [@agrobbin](https://github.com/agrobbin).
16
+ * [#360](https://github.com/slack-ruby/slack-ruby-client/pull/360): Remove faye-websocket from the concurrency detection error message - [@dblock](https://github.com/dblock).
17
+ * [#369](https://github.com/slack-ruby/slack-ruby-client/pull/369): Support rack requests in `Slack::Events::Request` - [@wedgex](https://github.com/wedgex).
18
+
19
+ ### 0.16.0 (2021/01/24)
20
+
21
+ * [#350](https://github.com/slack-ruby/slack-ruby-client/pull/350): Handle server errors such as timeouts & non-JSON responses - [@ojab](https://github.com/ojab).
22
+ * [#354](https://github.com/slack-ruby/slack-ruby-client/pull/354): Rewind body after checking request signature - [@sunny](https://github.com/sunny).
23
+ * [#355](https://github.com/slack-ruby/slack-ruby-client/pull/355), [#357](https://github.com/slack-ruby/slack-ruby-client/pull/357): Removed `celluloid-io` and `faye-websocket` support - [@wasabigeek](https://github.com/wasabigeek).
24
+ * [#356](https://github.com/slack-ruby/slack-ruby-client/pull/356): Added `admin_apps_clearResolution`, `admin_conversations_getCustomRetention`, `admin_conversations_removeCustomRetention`, `admin_conversations_setCustomRetention`, `admin_users_session_list` and `auth_teams_list` endpoints - [@dblock](https://github.com/dblock).
25
+ * [#348](https://github.com/slack-ruby/slack-ruby-client/pull/348): Added `admin_conversations_archive`, `admin_conversations_convertToPrivate`, `admin_conversations_create`, `admin_conversations_delete`, `admin_conversations_disconnectShared`, `admin_conversations_getConversationPrefs`, `admin_conversations_getTeams`, `admin_conversations_invite`, `admin_conversations_rename`, `admin_conversations_search`, `admin_conversations_setConversationPrefs`, `admin_conversations_unarchive`, `admin_conversations_ekm_listOriginalConnectedChannelInfo`, `admin_users_session_invalidate`, `apps_event_authorizations_list`, `conversations_mark`, `workflows_stepCompleted`, `workflows_stepFailed` and `workflows_updateStep` endpoints - [@wasabigeek](https://github.com/wasabigeek).
26
+
27
+ ### 0.15.1 (2020/9/3)
28
+
29
+ * [#336](https://github.com/slack-ruby/slack-ruby-client/pull/336): Fix: handle nil events - [@pyama86](https://github.com/pyama86).
30
+ * [#339](https://github.com/slack-ruby/slack-ruby-client/pull/339): Fix: `channel_not_found` resolving channel IDs with 100+ channels - [@dblock](https://github.com/dblock).
31
+ * [#340](https://github.com/slack-ruby/slack-ruby-client/pull/340): Added `adapter` configuration setting to change the `Faraday` HTTP adapter - [@watsonjon](https://github.com/watsonjon).
32
+
33
+ ### 0.15.0 (2020/7/26)
34
+
35
+ * [#322](https://github.com/slack-ruby/slack-ruby-client/pull/322): Cache `Faraday::Connection` for persistent adapters - [@drbrain](https://github.com/drbrain).
36
+ * [#324](https://github.com/slack-ruby/slack-ruby-client/pull/324): Require Faraday >= 1.0 - [@dblock](https://github.com/dblock).
37
+ * [#324](https://github.com/slack-ruby/slack-ruby-client/pull/324): Upgrade slack-ruby-danger, rubocop, rubocop-rspec and rubocop-performance - [@dblock](https://github.com/dblock).
38
+ * [#327](https://github.com/slack-ruby/slack-ruby-client/pull/327), [#326](https://github.com/slack-ruby/slack-ruby-client/pull/326): Added `admin_conversations_whitelist`, `admin_usergroups`, `calls` and `calls_participants` endpoints - [@wasabigeek](https://github.com/wasabigeek).
39
+ * [#329](https://github.com/slack-ruby/slack-ruby-client/pull/329): Log when methods are deprecated - [@wasabigeek](https://github.com/wasabigeek).
40
+ * [#325](https://github.com/slack-ruby/slack-ruby-client/pull/325): Remove activesupport dependency - [@ianks](https://github.com/ianks).
41
+ * [#331](https://github.com/slack-ruby/slack-ruby-client/pull/331): Use `conversations_list` instead of deprecated `channels_list`. Added `admin_conversations_restrictAccess_addGroup`, `admin_conversations_restrictAccess_listGroups` and `admin_conversations_restrictAccess_removeGroup` endpoints - [@wasabigeek](https://github.com/wasabigeek).
42
+
1
43
  ### 0.14.6 (2020/3/28)
2
44
 
3
45
  * [#305](https://github.com/slack-ruby/slack-ruby-client/pull/305): Added `admin_inviteRequests_approve`, `admin_inviteRequests_deny`, `admin_inviteRequests_list`, `admin_inviteRequests_approved_list`, `admin_inviteRequests_denied_list`, `admin_teams_create`, `admin_teams_list`, `admin_teams_admins_list`, `admin_teams_owners_list`, `admin_teams_settings`, `admin_teams_settings_setIcon`, `admin_teams_settings_setName`, `admin_teams_settings_setDescription`, `admin_users_assign`, `admin_users_invite`, `admin_users_remove`, `admin_users_setAdmin`, `admin_users_setOwner` and `admin_users_setRegular` endpoints - [@manuelmeurer](https://github.com/manuelmeurer).
data/CONTRIBUTING.md CHANGED
@@ -29,9 +29,9 @@ bundle exec rake
29
29
 
30
30
  Sign up for Slack, create a private slack group for yourself.
31
31
 
32
- Create a new Bot Integration under [services/new/bot](http://slack.com/services/new/bot).
32
+ Create a new App under [https://api.slack.com/apps](https://api.slack.com/apps).
33
33
 
34
- ![](screenshots/register-bot.png)
34
+ ![](screenshots/create-app.png)
35
35
 
36
36
  On the next screen, note the API token.
37
37
 
@@ -68,20 +68,31 @@ Make sure that `bundle exec rake` completes without errors.
68
68
  Slack Web API is updated from https://github.com/slack-ruby/slack-api-ref, a maintained, machine-readable version of Slack API Docs, generated by scraping [api.slack.com](https://api.slack.com). To update the Web API from the latest definition run the following Rake task.
69
69
 
70
70
  ```
71
- rake slack:api:update
71
+ bundle exec rake slack:api:update
72
72
  ```
73
73
 
74
74
  #### Patching Slack Web API
75
75
 
76
76
  Sometimes it's necessary to patch auto-generated Slack Web API methods. For example, we want to help clients with calling `to_json` on the `attachments` parameter sent to `chat_postMessage`. See [#20](https://github.com/slack-ruby/slack-ruby-client/issues/20).
77
77
 
78
- Make a change to a generated file, for example `lib/slack/web/api/endpoints/chat.rb` and generate a patch.
78
+ The broad steps are:
79
+ 1. Run `rake slack:api:update` to check that existing patches are still valid.
80
+ - If you run into a `failed to apply patch` error, the auto-generated methods likely drifted from the last patch. Follow the steps [below](#resolving-patch-errors).
81
+ - This may add new methods if the API has updated, please split them up into multiple PRs if so.
82
+ 2. Make a change to a generated file, for example `lib/slack/web/api/endpoints/chat.rb`.
83
+ 3. Generate a patch:
84
+ ```
85
+ git diff --no-color HEAD lib/slack/web/api/endpoints/chat.rb > lib/slack/web/api/patches/chat.1.patch
86
+ ```
87
+ 4. Run `rake slack:api:update` to ensure that the patch is cleanly applied. Implement a test for the added or modified functionality and commit the patch file.
79
88
 
80
- ```
81
- git diff --no-color HEAD lib/slack/web/api/endpoints/chat.rb > lib/slack/web/api/patches/chat.1.patch
82
- ```
89
+ ##### Resolving Patch Errors
90
+
91
+ The auto-generated method files may drift overtime e.g. new arguments may be added or descriptions changed. Since previous patches were based on the older auto-generated files, git may be unable to apply them to the new files. Resolving them requires some good ol' splicing:
92
+ 1. Run `rake slack:api:update SKIP_PATCH=true` to create the raw auto-generated files. Commit the files that you are updating, so we can run `git diff` later.
93
+ 2. Go through the old patches for the files (e.g. in `lib/slack/web/api/patches/chat.1.patch`), copying code into the new files.
94
+ 3. Continue with Step 2 [above](#patching-slack-web-api).
83
95
 
84
- Run `rake slack:api:update` to ensure that the patch is cleanly applied. Implement a test for the added or modified functionality and commit the patch file.
85
96
 
86
97
  ### Write Documentation
87
98
 
data/Dangerfile CHANGED
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  danger.import_dangerfile(gem: 'slack-ruby-danger')
3
- toc.check
data/Gemfile CHANGED
@@ -13,6 +13,5 @@ if ENV.key?('CONCURRENCY')
13
13
  end
14
14
 
15
15
  group :test do
16
- gem 'danger-toc', '~> 0.1.3', require: false
17
- gem 'slack-ruby-danger', '~> 0.1.0', require: false
16
+ gem 'slack-ruby-danger', '~> 0.2.0', require: false
18
17
  end
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2015-2019 Daniel Doubrovkine, Artsy and Contributors
3
+ Copyright (c) 2015-2021 Daniel Doubrovkine, Artsy and Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -2,14 +2,14 @@ Slack Ruby Client
2
2
  =================
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/slack-ruby-client.svg)](http://badge.fury.io/rb/slack-ruby-client)
5
- [![Build Status](https://travis-ci.org/slack-ruby/slack-ruby-client.svg?branch=master)](https://travis-ci.org/slack-ruby/slack-ruby-client)
5
+ [![Build Status](https://app.travis-ci.com/slack-ruby/slack-ruby-client.svg?branch=master)](https://app.travis-ci.com/slack-ruby/slack-ruby-client)
6
6
  [![Code Climate](https://codeclimate.com/github/slack-ruby/slack-ruby-client/badges/gpa.svg)](https://codeclimate.com/github/slack-ruby/slack-ruby-client)
7
7
 
8
8
  A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messaging](https://api.slack.com/rtm) and [Events](https://api.slack.com/events-api) APIs. Comes with a handy command-line client, too. If you are not familiar with these concepts, you might want to watch [this video](http://code.dblock.org/2016/03/11/your-first-slack-bot-service-video.html).
9
9
 
10
10
  ![](slack.png)
11
11
 
12
- ## Table of Contents
12
+ # Table of Contents
13
13
 
14
14
  - [Useful to Me?](#useful-to-me)
15
15
  - [Stable Release](#stable-release)
@@ -31,6 +31,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
31
31
  - [Other](#other)
32
32
  - [Web Client Options](#web-client-options)
33
33
  - [Pagination Support](#pagination-support)
34
+ - [Character Encoding](#character-encoding)
34
35
  - [Error Handling](#error-handling)
35
36
  - [Slack Errors](#slack-errors)
36
37
  - [Rate Limiting](#rate-limiting)
@@ -46,8 +47,6 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
46
47
  - [Large Team Considerations](#large-team-considerations)
47
48
  - [Concurrency](#concurrency)
48
49
  - [Async](#async)
49
- - [Faye::Websocket with Eventmachine](#fayewebsocket-with-eventmachine)
50
- - [Celluloid](#celluloid)
51
50
  - [Events API](#events-api)
52
51
  - [Configuring Slack::Events](#configuring-slackevents)
53
52
  - [Verifying the Request Signature](#verifying-the-request-signature)
@@ -71,7 +70,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
71
70
 
72
71
  ## Stable Release
73
72
 
74
- You're reading the documentation for the **stable** release of slack-ruby-client, 0.14.6. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
73
+ You're reading the documentation for the **stable** release of slack-ruby-client, v1.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
75
74
 
76
75
  ## Installation
77
76
 
@@ -81,7 +80,7 @@ Add to Gemfile.
81
80
  gem 'slack-ruby-client'
82
81
  ```
83
82
 
84
- If you're going to be using the RealTime client, add either `async-websocket`, `eventmachine` and `faye-websocket` or `celluloid-io`. See below for more information about concurrency. We recommend you use `async-websocket`.
83
+ If you're going to be using the RealTime client, add `async-websocket`. See below for more information about concurrency.
85
84
 
86
85
  ```
87
86
  gem 'async-websocket', '~> 0.8.0'
@@ -151,10 +150,10 @@ See a fully working example in [examples/hi_web](examples/hi_web/hi.rb).
151
150
 
152
151
  ##### List Channels
153
152
 
154
- List channels with [channels_list](https://api.slack.com/methods/channels.list).
153
+ List channels with [conversations_list](https://api.slack.com/methods/conversations.list).
155
154
 
156
155
  ```ruby
157
- channels = client.channels_list.channels
156
+ channels = client.conversations_list.channels
158
157
 
159
158
  general_channel = channels.detect { |c| c.name == 'general' }
160
159
  ```
@@ -176,14 +175,14 @@ client.files_upload(
176
175
 
177
176
  ##### Get Channel Info
178
177
 
179
- You can use a channel ID or name (prefixed with `#`) in all functions that take a `:channel` argument. Lookup by name is not supported by the Slack API and the `channels_id` method called invokes `channels_list` in order to locate the channel ID.
178
+ You can use a channel ID or name (prefixed with `#`) in all functions that take a `:channel` argument. Lookup by name is not supported by the Slack API and the `channels_id` method called invokes `conversations_list` in order to locate the channel ID.
180
179
 
181
180
  ```ruby
182
- client.channels_info(channel: 'C04KB5X4D') # calls channels_info
181
+ client.conversations_info(channel: 'C04KB5X4D') # calls conversations_info
183
182
  ```
184
183
 
185
184
  ```ruby
186
- client.channels_info(channel: '#general') # calls channels_list followed by channels_info
185
+ client.conversations_info(channel: '#general') # calls conversations_list followed by conversations_info
187
186
  ```
188
187
 
189
188
  ##### Get User Info
@@ -239,11 +238,12 @@ timeout | Optional open/read timeout in seconds.
239
238
  open_timeout | Optional connection open timeout in seconds.
240
239
  default_page_size | Optional page size for paginated requests, default is _100_.
241
240
  default_max_retries | Optional number of retries for paginated requests, default is _100_.
241
+ adapter | Optional HTTP adapter to use, defaults to `Faraday.default_adapter`.
242
242
 
243
243
  You can also pass request options, including `timeout` and `open_timeout` into individual calls.
244
244
 
245
245
  ```ruby
246
- client.channels_list(request: { timeout: 180 })
246
+ client.conversations_list(request: { timeout: 180 })
247
247
  ```
248
248
 
249
249
  You can also control what proxy options are used by modifying the `http_proxy` environment variable per [Net::HTTP's documentation](https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html#class-Net::HTTP-label-Proxies).
@@ -276,6 +276,24 @@ end
276
276
  all_members # many thousands of team members retrieved 10 at a time
277
277
  ```
278
278
 
279
+ #### Character Encoding
280
+
281
+ Note that Slack expects `text` to be UTF-8 encoded. If your messages appear with text such as `BAD+11` in Slack, check `text.encoding` and `.encode(Encoding::UTF_8)` your messages before sending them to Slack.
282
+
283
+ ```ruby
284
+ text = 'characters such as "Ñ", "Á", "É"'
285
+ text.encoding
286
+ => #<Encoding:UTF-8>
287
+ client.chat_postMessage(channel: '#general', text: text, as_user: true)
288
+ # renders 'characters such as "Ñ", "Á", "É"' in Slack
289
+
290
+ text = text.encode(Encoding::ISO_8859_1)
291
+ text.encoding
292
+ # => #<Encoding:ISO-8859-1>
293
+ client.chat_postMessage(channel: '#general', text: text, as_user: true)
294
+ # renders 'characters such as "BAD+11", "", "BAD+9"' in Slack
295
+ ```
296
+
279
297
  #### Error Handling
280
298
 
281
299
  ##### Slack Errors
@@ -306,7 +324,11 @@ If you exceed [Slack’s rate limits](https://api.slack.com/docs/rate-limits), a
306
324
 
307
325
  ##### Other Errors
308
326
 
309
- In any other case, a `Faraday::ClientError` will be raised. This may be the case if Slack is temporarily unavailable, for example.
327
+ When Slack is temporarily unavailable a subclass of `Slack::Web::Api::Errors::ServerError` will be raised and the original `Faraday::Error` will be accesible via `exception.cause`. (Starting with 0.18.0 this is no longer a subclass of `Slack::Web::Api::Errors::SlackError`.)
328
+
329
+ Specifically `Slack::Web::Api::Errors::ParsingError` will be raised on non-json response (i.e. 200 OK with `Slack unavailable` HTML page) and `Slack::Web::Api::Errors::HttpRequestError` subclasses for connection failures (`Slack::Web::Api::Errors::TimeoutError` for read/open timeouts & `Slack::Web::Api::Errors::UnavailableError` for 5xx HTTP responses).
330
+
331
+ In any other case, a `Faraday::ClientError` will be raised.
310
332
 
311
333
  ### RealTime Client
312
334
 
@@ -471,7 +493,7 @@ See [#134](https://github.com/slack-ruby/slack-ruby-client/issues/134) for a dis
471
493
 
472
494
  #### Concurrency
473
495
 
474
- `Slack::RealTime::Client` needs help from a concurrency library and supports [Async](https://github.com/socketry/async), [Faye::WebSocket](https://github.com/faye/faye-websocket-ruby) with [Eventmachine](https://github.com/eventmachine/eventmachine) and [Celluloid](https://github.com/celluloid/celluloid). It will auto-detect one or the other depending on the gems in your Gemfile, but you can also set concurrency explicitly.
496
+ `Slack::RealTime::Client` needs help from a concurrency library and supports [Async](https://github.com/socketry/async).
475
497
 
476
498
  ```ruby
477
499
  Slack::RealTime.configure do |config|
@@ -489,7 +511,7 @@ client.start_async
489
511
 
490
512
  ##### Async
491
513
 
492
- This is the recommended library. Add `async-websocket` to your Gemfile.
514
+ Add `async-websocket` to your Gemfile.
493
515
 
494
516
  ```
495
517
  gem 'async-websocket'
@@ -497,26 +519,6 @@ gem 'async-websocket'
497
519
 
498
520
  See a fully working example in [examples/hi_real_time_async_async](examples/hi_real_time_async_async/hi.rb).
499
521
 
500
- ##### Faye::Websocket with Eventmachine
501
-
502
- Add the following to your Gemfile.
503
-
504
- ```
505
- gem 'faye-websocket'
506
- ```
507
-
508
- See a fully working example in [examples/hi_real_time_async_eventmachine](examples/hi_real_time_async_eventmachine/hi.rb).
509
-
510
- ##### Celluloid
511
-
512
- Add the following to your Gemfile.
513
-
514
- ```
515
- gem 'celluloid-io', require: ['celluloid/current', 'celluloid/io']
516
- ```
517
-
518
- See a fully working example in [examples/hi_real_time_async_celluloid](examples/hi_real_time_async_celluloid/hi.rb).
519
-
520
522
  ### Events API
521
523
 
522
524
  This library provides limited support for the [Slack Events API](https://api.slack.com/events-api).
@@ -644,6 +646,6 @@ See [CONTRIBUTING](CONTRIBUTING.md).
644
646
 
645
647
  ## Copyright and License
646
648
 
647
- Copyright (c) 2015-2019, [Daniel Doubrovkine](https://twitter.com/dblockdotorg), [Artsy](https://www.artsy.net) and [Contributors](CHANGELOG.md).
649
+ Copyright (c) 2015-2021, [Daniel Doubrovkine](https://twitter.com/dblockdotorg), [Artsy](https://www.artsy.net) and [Contributors](CHANGELOG.md).
648
650
 
649
651
  This project is licensed under the [MIT License](LICENSE.md).
data/RELEASING.md CHANGED
@@ -11,7 +11,7 @@ bundle install
11
11
  rake
12
12
  ```
13
13
 
14
- Check that the last build succeeded in [Travis CI](https://travis-ci.org/slack-ruby/slack-ruby-client) for all supported platforms.
14
+ Check that the last build succeeded in [Travis CI](https://app.travis-ci.com/github/slack-ruby/slack-ruby-client) for all supported platforms.
15
15
 
16
16
  Change "Next" in [CHANGELOG.md](CHANGELOG.md) to the current date.
17
17