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.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.rubocop.yml +15 -3
- data/.rubocop_todo.yml +110 -38
- data/.travis.yml +2 -5
- data/CHANGELOG.md +42 -0
- data/CONTRIBUTING.md +19 -8
- data/Dangerfile +1 -1
- data/Gemfile +1 -2
- data/LICENSE.md +1 -1
- data/README.md +38 -36
- data/RELEASING.md +1 -1
- data/UPGRADING.md +62 -2
- data/bin/commands/admin_analytics.rb +16 -0
- data/bin/commands/admin_apps.rb +26 -2
- data/bin/commands/admin_apps_requests.rb +1 -0
- data/bin/commands/admin_auth_policy.rb +39 -0
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +155 -3
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
- data/bin/commands/admin_conversations_whitelist.rb +37 -0
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_teams.rb +1 -1
- data/bin/commands/admin_usergroups.rb +48 -0
- data/bin/commands/admin_users.rb +3 -2
- data/bin/commands/admin_users_session.rb +62 -0
- data/bin/commands/api.rb +0 -1
- data/bin/commands/apps_connections.rb +13 -0
- data/bin/commands/apps_event_authorizations.rb +16 -0
- data/bin/commands/apps_manifest.rb +51 -0
- data/bin/commands/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +1 -0
- data/bin/commands/calls.rb +52 -0
- data/bin/commands/calls_participants.rb +25 -0
- data/bin/commands/channels.rb +1 -155
- data/bin/commands/chat.rb +17 -12
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +71 -3
- data/bin/commands/dnd.rb +2 -0
- data/bin/commands/files.rb +6 -4
- data/bin/commands/files_remote.rb +2 -2
- data/bin/commands/groups.rb +1 -162
- data/bin/commands/im.rb +1 -63
- data/bin/commands/migration.rb +1 -0
- data/bin/commands/mpim.rb +1 -61
- data/bin/commands/oauth.rb +0 -13
- data/bin/commands/oauth_v2.rb +13 -1
- data/bin/commands/openid_connect.rb +27 -0
- data/bin/commands/pins.rb +2 -4
- data/bin/commands/reactions.rb +1 -0
- data/bin/commands/reminders.rb +6 -0
- data/bin/commands/rtm.rb +2 -2
- data/bin/commands/search.rb +4 -0
- data/bin/commands/stars.rb +7 -6
- data/bin/commands/team.rb +3 -0
- data/bin/commands/team_billing.rb +13 -0
- data/bin/commands/team_preferences.rb +13 -0
- data/bin/commands/tooling_tokens.rb +14 -0
- data/bin/commands/usergroups.rb +5 -0
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users.rb +4 -2
- data/bin/commands/users_profile.rb +5 -5
- data/bin/commands/views.rb +2 -2
- data/bin/commands/workflows.rb +38 -0
- data/bin/commands.rb +17 -8
- data/lib/slack/config.rb +1 -2
- data/lib/slack/events/request.rb +10 -4
- data/lib/slack/messages/message.rb +0 -4
- data/lib/slack/real_time/client.rb +6 -6
- data/lib/slack/real_time/concurrency/async.rb +7 -11
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/config.rb +5 -14
- data/lib/slack/real_time/models/base.rb +0 -4
- data/lib/slack/real_time/socket.rb +3 -4
- data/lib/slack/real_time/stores/base.rb +4 -7
- data/lib/slack/real_time/stores/starter.rb +6 -3
- data/lib/slack/real_time/stores/store.rb +5 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +42 -6
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +234 -4
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +10 -10
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +23 -23
- data/lib/slack/web/api/endpoints/admin_users_session.rb +97 -3
- data/lib/slack/web/api/endpoints/api.rb +1 -3
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
- data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
- data/lib/slack/web/api/endpoints/auth.rb +1 -1
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +3 -1
- data/lib/slack/web/api/endpoints/calls.rb +83 -0
- data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
- data/lib/slack/web/api/endpoints/channels.rb +1 -245
- data/lib/slack/web/api/endpoints/chat.rb +76 -66
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +5 -3
- data/lib/slack/web/api/endpoints/conversations.rb +149 -41
- data/lib/slack/web/api/endpoints/dialog.rb +2 -2
- data/lib/slack/web/api/endpoints/dnd.rb +6 -3
- data/lib/slack/web/api/endpoints/files.rb +21 -17
- data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
- data/lib/slack/web/api/endpoints/files_remote.rb +23 -23
- data/lib/slack/web/api/endpoints/groups.rb +0 -253
- data/lib/slack/web/api/endpoints/im.rb +0 -101
- data/lib/slack/web/api/endpoints/migration.rb +4 -2
- data/lib/slack/web/api/endpoints/mpim.rb +0 -96
- data/lib/slack/web/api/endpoints/oauth.rb +5 -30
- data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
- data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
- data/lib/slack/web/api/endpoints/pins.rb +7 -12
- data/lib/slack/web/api/endpoints/reactions.rb +16 -14
- data/lib/slack/web/api/endpoints/reminders.rb +17 -5
- data/lib/slack/web/api/endpoints/rtm.rb +10 -10
- data/lib/slack/web/api/endpoints/search.rb +27 -13
- data/lib/slack/web/api/endpoints/stars.rb +13 -11
- data/lib/slack/web/api/endpoints/team.rb +11 -5
- data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
- data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
- data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +26 -16
- data/lib/slack/web/api/endpoints/usergroups_users.rb +9 -5
- data/lib/slack/web/api/endpoints/users.rb +20 -18
- data/lib/slack/web/api/endpoints/users_profile.rb +7 -7
- data/lib/slack/web/api/endpoints/views.rb +13 -13
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/endpoints.rb +35 -18
- data/lib/slack/web/api/errors/server_error.rb +37 -0
- data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
- data/lib/slack/web/api/errors.rb +486 -12
- data/lib/slack/web/api/mixins/{channels.id.rb → conversations.id.rb} +3 -5
- data/lib/slack/web/api/mixins/ids.id.rb +3 -5
- data/lib/slack/web/api/mixins/users.id.rb +1 -3
- data/lib/slack/web/api/mixins.rb +1 -2
- data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +25 -24
- data/lib/slack/web/api/templates/endpoints.erb +1 -2
- data/lib/slack/web/api/templates/method.erb +4 -1
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/config.rb +2 -0
- data/lib/slack/web/faraday/connection.rb +23 -20
- data/lib/slack/web/faraday/request.rb +2 -1
- data/lib/slack/web/faraday/response/raise_error.rb +12 -1
- data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
- data/lib/slack/web/pagination/cursor.rb +3 -7
- data/lib/slack-ruby-client.rb +4 -4
- data/lib/tasks/web.rake +11 -3
- data/slack-ruby-client.gemspec +6 -7
- data/spec/fixtures/slack/web/429_error.yml +50 -54
- data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
- data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
- data/spec/fixtures/slack/web/conversations_info.yml +167 -0
- data/spec/fixtures/slack/web/conversations_setTopic.yml +84 -0
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +172 -0
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +253 -0
- data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
- data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
- data/spec/fixtures/slack/web/rtm_start.yml +771 -60
- data/spec/fixtures/slack/web/users_info.yml +153 -69
- data/spec/fixtures/slack/web/users_list.yml +102 -41
- data/spec/fixtures/slack/web/views_open_error.yml +49 -42
- data/spec/slack/events/request_spec.rb +13 -8
- data/spec/slack/real_time/client_spec.rb +35 -22
- data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
- data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
- data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
- data/spec/slack/real_time/rtm_start_spec.rb +1 -1
- data/spec/slack/slack_spec.rb +3 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +10 -0
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → admin_conversations_ekm_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +28 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
- data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → apps_connections_spec.rb} +1 -1
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -22
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
- data/spec/slack/web/api/endpoints/openid_connect_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/team_billing_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/api/error_spec.rb +5 -7
- data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
- data/spec/slack/web/api/mixins/{channels_spec.rb → conversations_spec.rb} +8 -8
- data/spec/slack/web/api/mixins/users_spec.rb +1 -1
- data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
- data/spec/slack/web/client_spec.rb +123 -1
- data/spec/slack/web/faraday/request_spec.rb +80 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +8 -6
- data/spec/spec_helper.rb +1 -1
- data/spec/support/real_time/connected_client.rb +1 -7
- data/spec/support/vcr.rb +36 -1
- metadata +95 -173
- data/examples/hi_real_time/Gemfile +0 -6
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -41
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
- data/examples/hi_real_time_async_celluloid/Procfile +0 -2
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
- data/lib/slack/web/api/mixins/channels.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.json +0 -20
- data/lib/slack/web/api/mixins/groups.id.rb +0 -27
- data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
- data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
- data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
- data/spec/fixtures/slack/web/503_error.yml +0 -14
- data/spec/fixtures/slack/web/channels_info.yml +0 -46
- data/spec/fixtures/slack/web/groups_info.yml +0 -43
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
- data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -101
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/im_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
- data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fa18d8339ff27661d942ef4d0cee003ff8e1146db504063a736374c5f5bf940
|
4
|
+
data.tar.gz: fc3bca990c3ad938a23db950b2008932a29518363360ada378856e71f2c1b477
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 932b6be224f16a7873a24907074944eea9ac8fcb47e35f7f9ef876d11df396197771c44727738b63267e4da45cd5c2050084972844a76fa6134fc54e2a9aa0d6
|
7
|
+
data.tar.gz: 8a5904155cd7b3d52fbeca8c9a0887bca7eabe4bb4b668174aa4accb5cfefb7784ec91f3e3d9182fef44d6a994168b72c4530c36a74cf2d7564eec6a0e204ea5
|
data/.github/FUNDING.yml
ADDED
@@ -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
|
-
|
23
|
+
Enabled: false
|
24
|
+
|
20
25
|
Metrics/ClassLength:
|
21
26
|
Max: 250
|
22
|
-
|
23
|
-
|
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
|
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:
|
10
|
-
# Configuration parameters:
|
11
|
-
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: Include.
|
11
|
+
# Include: **/*.gemspec
|
12
|
+
Gemspec/RequiredRubyVersion:
|
12
13
|
Exclude:
|
13
|
-
- '
|
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:
|
18
|
-
|
19
|
-
|
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:
|
47
|
+
Max: 14
|
24
48
|
|
25
|
-
# Offense count:
|
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:
|
62
|
+
Max: 16
|
33
63
|
|
34
|
-
# Offense count:
|
35
|
-
|
64
|
+
# Offense count: 2
|
65
|
+
# Cop supports --auto-correct.
|
66
|
+
Performance/RegexpMatch:
|
36
67
|
Exclude:
|
37
|
-
- '
|
68
|
+
- 'lib/tasks/web.rake'
|
38
69
|
|
39
|
-
# Offense count:
|
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:
|
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:
|
94
|
+
# Offense count: 16
|
51
95
|
# Configuration parameters: CustomTransform, IgnoreMethods.
|
52
96
|
RSpec/FilePath:
|
53
97
|
Enabled: false
|
54
98
|
|
55
|
-
# Offense count:
|
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:
|
70
|
-
# Configuration parameters: AggregateFailuresByDefault.
|
105
|
+
# Offense count: 95
|
71
106
|
RSpec/MultipleExpectations:
|
72
107
|
Max: 5
|
73
108
|
|
74
|
-
# Offense count:
|
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:
|
119
|
+
# Offense count: 2
|
79
120
|
RSpec/SubjectStub:
|
80
121
|
Exclude:
|
81
|
-
- 'spec/slack/web/api/mixins/
|
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:
|
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
|
32
|
+
Create a new App under [https://api.slack.com/apps](https://api.slack.com/apps).
|
33
33
|
|
34
|
-
![](screenshots/
|
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
|
-
|
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
|
-
|
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
data/Gemfile
CHANGED
data/LICENSE.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2015-
|
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.
|
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
|
-
|
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.
|
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
|
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 [
|
153
|
+
List channels with [conversations_list](https://api.slack.com/methods/conversations.list).
|
155
154
|
|
156
155
|
```ruby
|
157
|
-
channels = client.
|
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 `
|
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.
|
181
|
+
client.conversations_info(channel: 'C04KB5X4D') # calls conversations_info
|
183
182
|
```
|
184
183
|
|
185
184
|
```ruby
|
186
|
-
client.
|
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.
|
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
|
-
|
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)
|
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
|
-
|
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-
|
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.
|
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
|
|