slack-ruby-client 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/update_api.yml +1 -1
- data/.rubocop_todo.yml +43 -13
- data/CHANGELOG.md +12 -0
- data/CONTRIBUTING.md +7 -7
- data/Gemfile +1 -0
- data/README.md +46 -28
- data/bin/commands/admin_conversations.rb +21 -0
- data/bin/commands/admin_users_session.rb +1 -1
- data/bin/commands/admin_workflows.rb +3 -1
- data/bin/commands/admin_workflows_triggers_types_permissions.rb +4 -4
- data/bin/commands/assistant_threads.rb +45 -0
- data/bin/commands/bookmarks.rb +1 -0
- data/bin/commands/canvases.rb +4 -4
- data/bin/commands/canvases_access.rb +3 -3
- data/bin/commands/chat.rb +7 -3
- data/bin/commands/conversations.rb +5 -5
- data/bin/commands/conversations_canvases.rb +2 -2
- data/bin/commands/conversations_requestSharedInvite.rb +48 -0
- data/bin/commands/files.rb +2 -1
- data/bin/commands/usergroups.rb +5 -0
- data/bin/commands/usergroups_users.rb +2 -0
- data/examples/files_upload_v2/.env.example +1 -0
- data/examples/files_upload_v2/Gemfile +5 -0
- data/examples/files_upload_v2/README.md +13 -0
- data/examples/files_upload_v2/files_upload_v2.rb +37 -0
- data/examples/oauth_v2/.env.example +4 -0
- data/examples/oauth_v2/Gemfile +7 -0
- data/examples/oauth_v2/README.md +33 -0
- data/examples/oauth_v2/oauth_v2.rb +60 -0
- data/lib/slack/messages/formatting.rb +1 -1
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_conversations.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_users_session.rb +2 -3
- data/lib/slack/web/api/endpoints/admin_workflows.rb +5 -1
- data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +2 -2
- data/lib/slack/web/api/endpoints/assistant_threads.rb +68 -0
- data/lib/slack/web/api/endpoints/bookmarks.rb +2 -0
- data/lib/slack/web/api/endpoints/canvases.rb +2 -2
- data/lib/slack/web/api/endpoints/canvases_access.rb +4 -4
- data/lib/slack/web/api/endpoints/chat.rb +12 -3
- data/lib/slack/web/api/endpoints/conversations.rb +4 -4
- data/lib/slack/web/api/endpoints/conversations_canvases.rb +1 -1
- data/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb +73 -0
- data/lib/slack/web/api/endpoints/files.rb +3 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
- data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
- data/lib/slack/web/api/endpoints.rb +4 -0
- data/lib/slack/web/api/errors.rb +48 -4
- data/lib/slack/web/api/helpers/files.rb +87 -0
- data/lib/slack/web/api/helpers.rb +13 -0
- data/lib/slack/web/api/templates/method_spec.erb +4 -3
- data/lib/slack/web/client.rb +1 -0
- data/lib/slack/web/faraday/connection.rb +13 -26
- data/lib/slack/web/faraday/options.rb +24 -0
- data/lib/slack/web/faraday/request.rb +2 -1
- data/lib/slack-ruby-client.rb +2 -0
- data/slack-ruby-client.gemspec +2 -1
- metadata +32 -154
- data/screenshots/create-app.png +0 -0
- data/spec/fixtures/slack/web/429_error.yml +0 -81
- data/spec/fixtures/slack/web/auth_test_error.yml +0 -81
- data/spec/fixtures/slack/web/auth_test_success.yml +0 -81
- data/spec/fixtures/slack/web/conversations_info.yml +0 -167
- data/spec/fixtures/slack/web/conversations_setTopic.yml +0 -84
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +0 -172
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +0 -253
- data/spec/fixtures/slack/web/paginated_users_list.yml +0 -613
- data/spec/fixtures/slack/web/rtm_connect.yml +0 -391
- data/spec/fixtures/slack/web/users_info.yml +0 -214
- data/spec/fixtures/slack/web/users_list.yml +0 -133
- data/spec/fixtures/slack/web/views_open_error.yml +0 -83
- data/spec/integration/integration_spec.rb +0 -207
- data/spec/slack/config_spec.rb +0 -16
- data/spec/slack/events/config_spec.rb +0 -35
- data/spec/slack/events/request_spec.rb +0 -199
- data/spec/slack/messages/formatting_spec.rb +0 -156
- data/spec/slack/real_time/api/message_spec.rb +0 -20
- data/spec/slack/real_time/api/ping_spec.rb +0 -17
- data/spec/slack/real_time/api/typing_spec.rb +0 -19
- data/spec/slack/real_time/client_spec.rb +0 -601
- data/spec/slack/real_time/concurrency/clients/async_spec.rb +0 -16
- data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +0 -21
- data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +0 -10
- data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +0 -10
- data/spec/slack/real_time/event_handlers/bot_spec.rb +0 -47
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +0 -16
- data/spec/slack/real_time/event_handlers/im_spec.rb +0 -51
- data/spec/slack/real_time/event_handlers/private_channel_spec.rb +0 -99
- data/spec/slack/real_time/event_handlers/public_channel_spec.rb +0 -123
- data/spec/slack/real_time/event_handlers/team_spec.rb +0 -63
- data/spec/slack/real_time/event_handlers/user_spec.rb +0 -65
- data/spec/slack/real_time/rtm_connect_spec.rb +0 -14
- data/spec/slack/real_time/stores/store_spec.rb +0 -50
- data/spec/slack/slack_spec.rb +0 -93
- data/spec/slack/version_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_apps_activities_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_apps_config_spec.rb +0 -18
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +0 -18
- data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +0 -35
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +0 -38
- data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +0 -32
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +0 -133
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +0 -37
- data/spec/slack/web/api/endpoints/admin_functions_permissions_spec.rb +0 -21
- data/spec/slack/web/api/endpoints/admin_functions_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +0 -18
- data/spec/slack/web/api/endpoints/admin_roles_spec.rb +0 -30
- data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +0 -53
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +0 -37
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +0 -41
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +0 -67
- data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/admin_workflows_collaborators_spec.rb +0 -24
- data/spec/slack/web/api/endpoints/admin_workflows_permissions_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_workflows_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/admin_workflows_triggers_types_permissions_spec.rb +0 -21
- data/spec/slack/web/api/endpoints/api_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/apps_activities_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/apps_auth_external_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/apps_connections_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +0 -74
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +0 -44
- data/spec/slack/web/api/endpoints/apps_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/auth_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +0 -40
- data/spec/slack/web/api/endpoints/bots_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +0 -24
- data/spec/slack/web/api/endpoints/calls_spec.rb +0 -31
- data/spec/slack/web/api/endpoints/canvases_access_spec.rb +0 -21
- data/spec/slack/web/api/endpoints/canvases_sections_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/canvases_spec.rb +0 -21
- data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/chat_spec.rb +0 -134
- data/spec/slack/web/api/endpoints/conversations_canvases_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/conversations_externalInvitePermissions_spec.rb +0 -19
- data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +0 -27
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +0 -206
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +0 -40
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +0 -38
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +0 -112
- data/spec/slack/web/api/endpoints/dialog_spec.rb +0 -14
- data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -18
- data/spec/slack/web/api/endpoints/emoji_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +0 -24
- data/spec/slack/web/api/endpoints/files_spec.rb +0 -57
- data/spec/slack/web/api/endpoints/functions_distributions_permissions_spec.rb +0 -10
- data/spec/slack/web/api/endpoints/functions_spec.rb +0 -28
- data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/migration_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +0 -16
- data/spec/slack/web/api/endpoints/openid_connect_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/pins_spec.rb +0 -23
- data/spec/slack/web/api/endpoints/reactions_spec.rb +0 -24
- data/spec/slack/web/api/endpoints/reminders_spec.rb +0 -31
- data/spec/slack/web/api/endpoints/rtm_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/search_spec.rb +0 -23
- data/spec/slack/web/api/endpoints/stars_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/team_billing_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/team_externalTeams_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/team_preferences_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/team_profile_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/team_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/usergroups_spec.rb +0 -28
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +0 -21
- data/spec/slack/web/api/endpoints/users_admin_spec.rb +0 -18
- data/spec/slack/web/api/endpoints/users_discoverableContacts_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/users_prefs_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/users_profile_spec.rb +0 -14
- data/spec/slack/web/api/endpoints/users_spec.rb +0 -8
- data/spec/slack/web/api/endpoints/views_spec.rb +0 -65
- data/spec/slack/web/api/endpoints/workflows_spec.rb +0 -34
- data/spec/slack/web/api/endpoints/workflows_triggers_permissions_spec.rb +0 -31
- data/spec/slack/web/api/error_spec.rb +0 -14
- data/spec/slack/web/api/errors/slack_error_spec.rb +0 -33
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +0 -21
- data/spec/slack/web/api/mixins/conversations_spec.rb +0 -45
- data/spec/slack/web/api/mixins/users_spec.rb +0 -52
- data/spec/slack/web/api/options_spec.rb +0 -69
- data/spec/slack/web/api/pagination/cursor_spec.rb +0 -102
- data/spec/slack/web/client_spec.rb +0 -359
- data/spec/slack/web/faraday/request_spec.rb +0 -80
- data/spec/slack/web/faraday/response/raise_error_spec.rb +0 -86
- data/spec/spec_helper.rb +0 -30
- data/spec/support/queue_with_timeout.rb +0 -35
- data/spec/support/real_time/concurrency/mock.rb +0 -31
- data/spec/support/real_time/connected_client.rb +0 -21
- data/spec/support/real_time/event.rb +0 -12
- data/spec/support/real_time/loaded_client.rb +0 -120
- data/spec/support/token.rb +0 -11
- data/spec/support/vcr.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f433d0a8172888831bf4115f08a954719a90723fb5b2c3ae232a343b43e8fff3
|
4
|
+
data.tar.gz: d5689f3951b2b70f6e80143d57ec538c88b6df46445e6f85c4e26f357ce7ce59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21c7eb94417fa3071e6e95dcc588ca4affad4c4faa22bc878e175b1851e10090bbd304fbe6b27a7ff20650bd14b95ca4e92ed00de7ad5abf8f2e97a5d6375e57
|
7
|
+
data.tar.gz: 95e0922c4d5ef759d4a4cbea728aa27486ccb9a52167b28c24d2aeb2b178a11b121697d0a431e5ac9f6c800101f3f99a3a3b160a4f7d6b326d7db1f5cf2011bc
|
@@ -42,7 +42,7 @@ jobs:
|
|
42
42
|
installation_id: 36985419
|
43
43
|
- name: Create pull request
|
44
44
|
id: cpr
|
45
|
-
uses: peter-evans/create-pull-request@
|
45
|
+
uses: peter-evans/create-pull-request@v7
|
46
46
|
with:
|
47
47
|
token: ${{ secrets.GITHUB_TOKEN }}
|
48
48
|
commit-message: Update API from slack-api-ref@${{ steps.api-ref.outputs.api-ref }} (${{ steps.date.outputs.date }})
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2025-02-08 15:52:13 UTC using RuboCop version 1.26.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
|
@@ -44,30 +44,42 @@ Lint/RedundantCopDisableDirective:
|
|
44
44
|
Exclude:
|
45
45
|
- 'lib/slack-ruby-client.rb'
|
46
46
|
|
47
|
-
# Offense count:
|
47
|
+
# Offense count: 13
|
48
48
|
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
49
49
|
Metrics/AbcSize:
|
50
|
-
Max:
|
50
|
+
Max: 58
|
51
51
|
|
52
|
-
# Offense count:
|
52
|
+
# Offense count: 6
|
53
53
|
# Configuration parameters: IgnoredMethods.
|
54
54
|
Metrics/CyclomaticComplexity:
|
55
|
-
Max:
|
55
|
+
Max: 11
|
56
56
|
|
57
|
-
# Offense count:
|
57
|
+
# Offense count: 15
|
58
58
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
59
59
|
Metrics/MethodLength:
|
60
|
-
Max:
|
60
|
+
Max: 35
|
61
61
|
|
62
62
|
# Offense count: 1
|
63
63
|
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
64
64
|
Metrics/ParameterLists:
|
65
65
|
Max: 6
|
66
66
|
|
67
|
-
# Offense count:
|
67
|
+
# Offense count: 3
|
68
68
|
# Configuration parameters: IgnoredMethods.
|
69
69
|
Metrics/PerceivedComplexity:
|
70
|
-
Max:
|
70
|
+
Max: 12
|
71
|
+
|
72
|
+
# Offense count: 1
|
73
|
+
# Configuration parameters: MinSize.
|
74
|
+
Performance/CollectionLiteralInLoop:
|
75
|
+
Exclude:
|
76
|
+
- 'spec/slack/web/api/endpoints/custom_specs/files_spec.rb'
|
77
|
+
|
78
|
+
# Offense count: 1
|
79
|
+
# This cop supports safe auto-correction (--auto-correct).
|
80
|
+
Performance/MapCompact:
|
81
|
+
Exclude:
|
82
|
+
- 'lib/slack/web/api/helpers/files.rb'
|
71
83
|
|
72
84
|
# Offense count: 2
|
73
85
|
# This cop supports safe auto-correction (--auto-correct).
|
@@ -81,20 +93,20 @@ Performance/StringInclude:
|
|
81
93
|
Exclude:
|
82
94
|
- 'lib/tasks/web.rake'
|
83
95
|
|
84
|
-
# Offense count:
|
96
|
+
# Offense count: 9
|
85
97
|
# This cop supports safe auto-correction (--auto-correct).
|
86
98
|
RSpec/ContextMethod:
|
87
99
|
Exclude:
|
88
100
|
- 'spec/slack/messages/formatting_spec.rb'
|
89
101
|
- 'spec/slack/web/api/mixins/users_spec.rb'
|
90
102
|
|
91
|
-
# Offense count:
|
103
|
+
# Offense count: 83
|
92
104
|
# Configuration parameters: Prefixes.
|
93
105
|
# Prefixes: when, with, without
|
94
106
|
RSpec/ContextWording:
|
95
107
|
Enabled: false
|
96
108
|
|
97
|
-
# Offense count:
|
109
|
+
# Offense count: 70
|
98
110
|
# Configuration parameters: CountAsOne.
|
99
111
|
RSpec/ExampleLength:
|
100
112
|
Max: 18
|
@@ -111,7 +123,7 @@ RSpec/FilePath:
|
|
111
123
|
RSpec/MessageSpies:
|
112
124
|
EnforcedStyle: receive
|
113
125
|
|
114
|
-
# Offense count:
|
126
|
+
# Offense count: 95
|
115
127
|
RSpec/MultipleExpectations:
|
116
128
|
Max: 5
|
117
129
|
|
@@ -166,6 +178,13 @@ Rake/Desc:
|
|
166
178
|
Exclude:
|
167
179
|
- 'lib/tasks/git.rake'
|
168
180
|
|
181
|
+
# Offense count: 1
|
182
|
+
# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols.
|
183
|
+
# SupportedStyles: inline, group
|
184
|
+
Style/AccessModifierDeclarations:
|
185
|
+
Exclude:
|
186
|
+
- 'lib/slack/real_time/client.rb'
|
187
|
+
|
169
188
|
# Offense count: 4
|
170
189
|
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
|
171
190
|
# SupportedStyles: annotated, template, unannotated
|
@@ -181,6 +200,17 @@ Style/GlobalStdStream:
|
|
181
200
|
- 'spec/integration/integration_spec.rb'
|
182
201
|
- 'spec/slack/web/client_spec.rb'
|
183
202
|
|
203
|
+
# Offense count: 1
|
204
|
+
# This cop supports unsafe auto-correction (--auto-correct-all).
|
205
|
+
Style/MapToHash:
|
206
|
+
Exclude:
|
207
|
+
- 'spec/slack/web/api/endpoints/custom_specs/files_spec.rb'
|
208
|
+
|
209
|
+
# Offense count: 1
|
210
|
+
Style/MultilineBlockChain:
|
211
|
+
Exclude:
|
212
|
+
- 'lib/slack/web/api/helpers/files.rb'
|
213
|
+
|
184
214
|
# Offense count: 1
|
185
215
|
# This cop supports safe auto-correction (--auto-correct).
|
186
216
|
Style/MultilineTernaryOperator:
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
### 2.5.0 (2025/02/09)
|
2
|
+
|
3
|
+
* [#525](https://github.com/slack-ruby/slack-ruby-client/pull/525): Exclude spec files from gem package - [@amatsuda](https://github.com/amatsuda).
|
4
|
+
* [#527](https://github.com/slack-ruby/slack-ruby-client/pull/527): Explicitly require `racc` and `ostruct` - [@dblock](https://github.com/dblock).
|
5
|
+
* [#528](https://github.com/slack-ruby/slack-ruby-client/pull/528): Don't treat asterisks in list items as italic in markdown - [@rspeicher](https://github.com/rspeicher).
|
6
|
+
* [#530](https://github.com/slack-ruby/slack-ruby-client/pull/530): Specify dependency on `logger` - [@rwstauner](https://github.com/rwstauner).
|
7
|
+
* [#533](https://github.com/slack-ruby/slack-ruby-client/pull/533), [#536](https://github.com/slack-ruby/slack-ruby-client/pull/536): Added `files_upload_v2` - [@gregsaab](https://github.com/gregsaab).
|
8
|
+
* [#538](https://github.com/slack-ruby/slack-ruby-client/pull/538): Translate channel names and support an array of channels in `files_upload_v2` - [@dblock](https://github.com/dblock).
|
9
|
+
* [#540](https://github.com/slack-ruby/slack-ruby-client/pull/540): Added support for `channel` and `channel_id`, do not require channel in `files_upload_v2` - [@dblock](https://github.com/dblock).
|
10
|
+
* [#541](https://github.com/slack-ruby/slack-ruby-client/pull/541): Added samples for `oauth_v2` and `files_upload_v2` - [@dblock](https://github.com/dblock).
|
11
|
+
* [#524](https://github.com/slack-ruby-client/pulls/524): Update API from [slack-api-ref@3ec3c10](https://github.com/slack-ruby/slack-api-ref/commit/3ec3c10) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
|
12
|
+
|
1
13
|
### 2.4.0 (2024/07/14)
|
2
14
|
|
3
15
|
* [#516](https://github.com/slack-ruby/slack-ruby-client/pull/516): Add support for Ruby 3.3 - [@olleolleolle](https://github.com/olleolleolle).
|
data/CONTRIBUTING.md
CHANGED
@@ -27,15 +27,15 @@ bundle exec rake
|
|
27
27
|
|
28
28
|
### Run Examples in Development
|
29
29
|
|
30
|
-
Sign up for Slack, create a private
|
30
|
+
Sign up for Slack, create a private Slack team for yourself, then [generate an API token](https://api.slack.com/tutorials/tracks/getting-a-token) for your app and use it for some interactions.
|
31
31
|
|
32
|
-
|
32
|
+
Try running the examples in the [examples](examples) directory.
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
```bash
|
35
|
+
cd examples/hi_web
|
36
|
+
bundle install
|
37
|
+
SLACK_API_TOKEN=... bundle exec ruby hi.rb
|
38
|
+
```
|
39
39
|
|
40
40
|
## Contribute Code
|
41
41
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -54,14 +54,14 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
54
54
|
- [Verifying the Request Signature](#verifying-the-request-signature)
|
55
55
|
- [Message Handling](#message-handling)
|
56
56
|
- [Formatting Messages](#formatting-messages)
|
57
|
-
- [Date and
|
58
|
-
- [Channel ID
|
59
|
-
- [User ID
|
60
|
-
- [URL
|
61
|
-
- [Markdown
|
57
|
+
- [Date and Time Formatting](#date-and-time-formatting)
|
58
|
+
- [Channel ID Formatting](#channel-id-formatting)
|
59
|
+
- [User ID Formatting](#user-id-formatting)
|
60
|
+
- [URL Formatting](#url-formatting)
|
61
|
+
- [Markdown Formatting](#markdown-formatting)
|
62
62
|
- [Parsing Messages](#parsing-messages)
|
63
|
-
- [Unescaping
|
64
|
-
- [Escaping
|
63
|
+
- [Unescaping Message Content](#unescaping-message-content)
|
64
|
+
- [Escaping Message Content](#escaping-message-content)
|
65
65
|
- [Command-Line Client](#command-line-client)
|
66
66
|
- [Authenticate with Slack](#authenticate-with-slack)
|
67
67
|
- [Send a Message](#send-a-message)
|
@@ -75,14 +75,13 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
75
75
|
|
76
76
|
## Useful to Me?
|
77
77
|
|
78
|
-
* This library
|
79
|
-
* To
|
80
|
-
* To
|
81
|
-
* To roll out a complete service using the Real Time Messaging API with Slack button integration to multiple teams, check out [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server), which is built on top of slack-ruby-bot, which uses this library.
|
78
|
+
* This library lets you send messages to Slack via the Web API, send and receive messages via the Real Time Messaging API, and facilitates integration with the Events API.
|
79
|
+
* To write a complete bot for Slack you need more than this library, and it's much easier to start with [slack-ruby-bot-server-events](https://github.com/slack-ruby/slack-ruby-bot-server-events).
|
80
|
+
* To respond to slash commands, interactive components, or events at the lowest level, implement a web application using your favorite web framework, and use this library to call the Slack Web API, and to verify that events are coming from Slack.
|
82
81
|
|
83
82
|
## Stable Release
|
84
83
|
|
85
|
-
You're reading the documentation for the **
|
84
|
+
You're reading the documentation for the **stable** release of slack-ruby-client 2.5.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
|
86
85
|
|
87
86
|
## Installation
|
88
87
|
|
@@ -106,11 +105,9 @@ Run `bundle install`.
|
|
106
105
|
|
107
106
|
To integrate your bot with Slack, you must first create a new [Slack App](https://api.slack.com/apps).
|
108
107
|
|
109
|
-

|
110
|
-
|
111
108
|
### OAuth Code Grant
|
112
109
|
|
113
|
-
Once created, go to the app's Basic Info tab and grab the Client ID and Client Secret.
|
110
|
+
Once created, go to the app's Basic Info tab and grab the Client ID and Client Secret. You'll need these in order complete an [OAuth Workflow](https://api.slack.com/authentication/oauth-v2). A working sample that starts a local web server and obtains a bot or a user token for your app using OAuth v2 is available in [examples/oauth_v2](examples/oauth_v2).
|
114
111
|
|
115
112
|
### Using an API Token
|
116
113
|
|
@@ -172,7 +169,28 @@ general_channel = channels.detect { |c| c.name == 'general' }
|
|
172
169
|
|
173
170
|
##### Upload a File
|
174
171
|
|
175
|
-
Upload
|
172
|
+
Upload files with [sequenced API calls](https://api.slack.com/messaging/files#uploading_files).
|
173
|
+
|
174
|
+
This library provides a helper method `files_upload_v2` that wraps the three separate API calls.
|
175
|
+
|
176
|
+
```ruby
|
177
|
+
client.files_upload_v2(
|
178
|
+
# required options
|
179
|
+
filename: 'results.pdf', # this is used for the file title, unless a :title option is provided
|
180
|
+
contents: File.read('/users/me/results.pdf'), # the string contents of the file
|
181
|
+
|
182
|
+
# optional options
|
183
|
+
channels: ['C000000', 'C000001'], # channel IDs to share the file in (:channel_id, :channel, or :channels are all supported)
|
184
|
+
initial_comment: 'Sharing the Q1 results :tada:', # the message that is included with the file share thread
|
185
|
+
snippet_type: 'text', # the type of snippet
|
186
|
+
title: 'Q1 Results', # sets the title of the file, overriding the filename
|
187
|
+
thread_ts: '1738331487.481469' # specifies a thread to add this file to
|
188
|
+
)
|
189
|
+
```
|
190
|
+
|
191
|
+
You can use a channel ID passed as `channel_id`, a single channel as `channel`, an array of channel IDs as `channels`, or a channel name or names (prefixed with `#`) in `files_upload_v2`. Lookup by name is not supported by the Slack API and this method called invokes `conversations_list` in order to locate the channel ID. This invocation can have a cost if you have many Slack channels and is only recommended when you intend to list channels anyway.
|
192
|
+
|
193
|
+
Note: This library includes a `files_upload` method that uses a deprecated endpoint `files.upload` that will [no longer be supported on 3/11/2025](https://api.slack.com/methods/files.upload#markdown).
|
176
194
|
|
177
195
|
```ruby
|
178
196
|
client.files_upload(
|
@@ -596,15 +614,15 @@ The `verify!` call may raise `Slack::Events::Request::MissingSigningSecret`, `Sl
|
|
596
614
|
|
597
615
|
### Message Handling
|
598
616
|
|
599
|
-
All text in Slack uses the same [system of
|
617
|
+
All text in Slack uses the same [system of Formatting and escaping](https://api.slack.com/docs/formatting): chat messages, direct messages, file comments, etc. [Slack::Messages::Formatting](lib/slack/messages/formatting.rb) provides convenience methods to format and parse messages.
|
600
618
|
|
601
619
|
#### Formatting Messages
|
602
620
|
|
603
|
-
`Slack::Messages::Formatting` provides a number of methods for
|
621
|
+
`Slack::Messages::Formatting` provides a number of methods for Formatting objects that you can then embed in outgoing messages.
|
604
622
|
|
605
|
-
##### Date and
|
623
|
+
##### Date and Time Formatting
|
606
624
|
|
607
|
-
You can embed a pre-formatted date in a message as a string like any other text, but using Slack's date
|
625
|
+
You can embed a pre-formatted date in a message as a string like any other text, but using Slack's date Formatting allows you to display dates based on user preferences for dates and times, incorporating users' local time zones, and optionally using relative values like "yesterday", "today", or "tomorrow" when appropriate.
|
608
626
|
|
609
627
|
```ruby
|
610
628
|
date = Time.now
|
@@ -627,7 +645,7 @@ Slack::Messages::Formatting.date(date, text: 'party time!')
|
|
627
645
|
# => "<!date^1688150386^{date_num} {time_secs}|party time!>"
|
628
646
|
```
|
629
647
|
|
630
|
-
##### Channel ID
|
648
|
+
##### Channel ID Formatting
|
631
649
|
|
632
650
|
If you already know the channel name you can just embed it in the message as `#some-channel`, but if you only have the ID you can embed it using special syntax which Slack will display as the channel name (while respecting channel visibility).
|
633
651
|
|
@@ -637,7 +655,7 @@ Slack::Messages::Formatting.channel_link(channel_id)
|
|
637
655
|
# => "<#C0000000001>"
|
638
656
|
```
|
639
657
|
|
640
|
-
##### User ID
|
658
|
+
##### User ID Formatting
|
641
659
|
|
642
660
|
If you already know the user name you can just embed it in the message as `@some_username`, but if you only have the ID you can embed it using special syntax which Slack will display as the user name.
|
643
661
|
|
@@ -647,9 +665,9 @@ Slack::Messages::Formatting.user_link(user_id)
|
|
647
665
|
# => "<@U0000000001>"
|
648
666
|
```
|
649
667
|
|
650
|
-
##### URL
|
668
|
+
##### URL Formatting
|
651
669
|
|
652
|
-
Slack will automatically parse fully qualified URLs in messages, but you need special
|
670
|
+
Slack will automatically parse fully qualified URLs in messages, but you need special Formatting to embed a link with different text.
|
653
671
|
|
654
672
|
```ruby
|
655
673
|
text = 'party time'
|
@@ -658,9 +676,9 @@ Slack::Messages::Formatting.url_link(text, url)
|
|
658
676
|
# => "<https://media.giphy.com/media/AcfTF7tyikWyroP0x7/giphy.gif|party time>"
|
659
677
|
```
|
660
678
|
|
661
|
-
##### Markdown
|
679
|
+
##### Markdown Formatting
|
662
680
|
|
663
|
-
Slack uses a mishmash of regular markdown
|
681
|
+
Slack uses a mishmash of regular markdown Formatting with its own syntax. Some features like headings aren't supported and will be left as-is, but others like bold, strikethrough, and links are converted.
|
664
682
|
|
665
683
|
```ruby
|
666
684
|
text = """
|
@@ -686,7 +704,7 @@ Slack::Messages::Formatting.markdown(text)
|
|
686
704
|
|
687
705
|
`Slack::Messages::Formatting` also provides ways to escape or unescape messages. This comes handy, for example, you want to treat all input to a real time bot as plain text.
|
688
706
|
|
689
|
-
##### Unescaping
|
707
|
+
##### Unescaping Message Content
|
690
708
|
|
691
709
|
```ruby
|
692
710
|
Slack::Messages::Formatting.unescape('Hello & <world>')
|
@@ -711,7 +729,7 @@ Slack::Messages::Formatting.unescape('‘hello’')
|
|
711
729
|
# => "'hello'"
|
712
730
|
```
|
713
731
|
|
714
|
-
##### Escaping
|
732
|
+
##### Escaping Message Content
|
715
733
|
|
716
734
|
```ruby
|
717
735
|
Slack::Messages::Formatting.escape('Hello & <world>')
|
@@ -133,6 +133,17 @@ module Slack
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
+
g.desc 'Link a Salesforce record to a channel'
|
137
|
+
g.long_desc %( Link a Salesforce record to a channel )
|
138
|
+
g.command 'linkObjects' do |c|
|
139
|
+
c.flag 'channel', desc: 'Channel ID for Slack channel that will be linked to a Salesforce record.'
|
140
|
+
c.flag 'record_id', desc: 'Salesforce record ID (15 or 18 digit accepted). See here for how to look up record ID.'
|
141
|
+
c.flag 'salesforce_org_id', desc: 'Salesforce org ID (15 or 18 digit accepted). See here for how to look up Salesforce org ID.'
|
142
|
+
c.action do |_global_options, options, _args|
|
143
|
+
puts JSON.dump(@client.admin_conversations_linkObjects(options))
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
136
147
|
g.desc 'Returns channels on the given team using the filters.'
|
137
148
|
g.long_desc %( Returns channels on the given team using the filters. )
|
138
149
|
g.command 'lookup' do |c|
|
@@ -222,6 +233,16 @@ module Slack
|
|
222
233
|
puts JSON.dump(@client.admin_conversations_unarchive(options))
|
223
234
|
end
|
224
235
|
end
|
236
|
+
|
237
|
+
g.desc 'Unlink a Salesforce record from a channel'
|
238
|
+
g.long_desc %( Unlink a Salesforce record from a channel )
|
239
|
+
g.command 'unlinkObjects' do |c|
|
240
|
+
c.flag 'channel', desc: 'Channel ID for Slack channel that will be unlinked from the Salesforce record.'
|
241
|
+
c.flag 'new_name', desc: 'Channel name you would like to give to the channel that is being unlinked from the Salesforce record.'
|
242
|
+
c.action do |_global_options, options, _args|
|
243
|
+
puts JSON.dump(@client.admin_conversations_unlinkObjects(options))
|
244
|
+
end
|
245
|
+
end
|
225
246
|
end
|
226
247
|
end
|
227
248
|
end
|
@@ -28,7 +28,7 @@ module Slack
|
|
28
28
|
g.long_desc %( Revoke a single session for a user. The user will be forced to login to Slack. )
|
29
29
|
g.command 'invalidate' do |c|
|
30
30
|
c.flag 'session_id', desc: 'ID of the session to invalidate.'
|
31
|
-
c.flag '
|
31
|
+
c.flag 'user_id', desc: 'ID of the user that the session belongs to.'
|
32
32
|
c.action do |_global_options, options, _args|
|
33
33
|
puts JSON.dump(@client.admin_users_session_invalidate(options))
|
34
34
|
end
|
@@ -10,16 +10,18 @@ module Slack
|
|
10
10
|
g.long_desc %( Search workflows within the team or enterprise )
|
11
11
|
g.command 'search' do |c|
|
12
12
|
c.flag 'app_id', desc: 'The parent app ID for which to return workflows.'
|
13
|
-
c.flag 'collaborator_ids', desc: 'Only include workflows where the provided user IDs are a manager/collaborator of that workflow.'
|
13
|
+
c.flag 'collaborator_ids', desc: 'Only include workflows where all of the provided user IDs are a manager/collaborator of that workflow.'
|
14
14
|
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
15
15
|
c.flag 'is_sales_elevate', desc: 'Filter workflows by their Sales Elevate status.'
|
16
16
|
c.flag 'limit', desc: 'The number of results that will be returned by the API on each invocation.'
|
17
17
|
c.flag 'no_collaborators', desc: 'Only include workflows with no collaborators in the result; default is false.'
|
18
18
|
c.flag 'num_trigger_ids', desc: 'Number of trigger IDs to fetch for each workflow; default is 10.'
|
19
|
+
c.flag 'publish_status', desc: 'Filter workflows by their published status.'
|
19
20
|
c.flag 'query', desc: 'A search query to filter for workflow name or description.'
|
20
21
|
c.flag 'sort', desc: 'The field used to sort the returned workflows.'
|
21
22
|
c.flag 'sort_dir', desc: 'Sort direction. Possible values are asc for ascending order like (1, 2, 3) or (a, b, c), and desc for descending order like (3, 2, 1) or (c, b, a).'
|
22
23
|
c.flag 'source', desc: 'Source of workflow creation, either from code or workflow builder.'
|
24
|
+
c.flag 'step_function_ids', desc: 'Only include workflows that use all of the provided step function ids.'
|
23
25
|
c.flag 'trigger_type_id', desc: 'Only include workflows with this trigger type.'
|
24
26
|
c.action do |_global_options, options, _args|
|
25
27
|
puts JSON.dump(@client.admin_workflows_search(options))
|
@@ -6,8 +6,8 @@ module Slack
|
|
6
6
|
class App
|
7
7
|
desc 'AdminWorkflowsTriggersTypesPermissions methods.'
|
8
8
|
command 'admin_workflows_triggers_types_permissions' do |g|
|
9
|
-
g.desc 'list the permissions for using each trigger type
|
10
|
-
g.long_desc %( list the permissions for using each trigger type
|
9
|
+
g.desc 'list the permissions for using each trigger type'
|
10
|
+
g.long_desc %( list the permissions for using each trigger type )
|
11
11
|
g.command 'lookup' do |c|
|
12
12
|
c.flag 'trigger_type_ids', desc: 'The trigger types IDs for which to get the permissions.'
|
13
13
|
c.action do |_global_options, options, _args|
|
@@ -15,8 +15,8 @@ module Slack
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
g.desc 'Set the permissions for using a trigger type
|
19
|
-
g.long_desc %( Set the permissions for using a trigger type
|
18
|
+
g.desc 'Set the permissions for using a trigger type'
|
19
|
+
g.long_desc %( Set the permissions for using a trigger type )
|
20
20
|
g.command 'set' do |c|
|
21
21
|
c.flag 'id', desc: 'The trigger type ID for which to set the permissions.'
|
22
22
|
c.flag 'visibility', desc: 'The function visibility.'
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Cli
|
6
|
+
class App
|
7
|
+
desc 'AssistantThreads methods.'
|
8
|
+
command 'assistant_threads' do |g|
|
9
|
+
g.desc 'Set the status for an AI assistant thread.'
|
10
|
+
g.long_desc %( Set the status for an AI assistant thread. )
|
11
|
+
g.command 'setStatus' do |c|
|
12
|
+
c.flag 'channel_id', desc: 'Channel ID containing the assistant thread.'
|
13
|
+
c.flag 'status', desc: "Status of the specified bot user, e.g. 'is thinking...'."
|
14
|
+
c.flag 'thread_ts', desc: 'Message timestamp of the thread of where to set the status.'
|
15
|
+
c.action do |_global_options, options, _args|
|
16
|
+
puts JSON.dump(@client.assistant_threads_setStatus(options))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
g.desc 'Set suggested prompts for the given assistant thread'
|
21
|
+
g.long_desc %( Set suggested prompts for the given assistant thread )
|
22
|
+
g.command 'setSuggestedPrompts' do |c|
|
23
|
+
c.flag 'channel_id', desc: 'Channel ID containing the assistant thread.'
|
24
|
+
c.flag 'prompts', desc: 'Each prompt should be supplied with its title and message attribute.'
|
25
|
+
c.flag 'thread_ts', desc: 'Message timestamp of the thread to set suggested prompts for.'
|
26
|
+
c.flag 'title', desc: 'Title for the list of provided prompts. For example: Suggested Prompts, Related Questions.'
|
27
|
+
c.action do |_global_options, options, _args|
|
28
|
+
puts JSON.dump(@client.assistant_threads_setSuggestedPrompts(options))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
g.desc 'Set the title for the given assistant thread'
|
33
|
+
g.long_desc %( Set the title for the given assistant thread )
|
34
|
+
g.command 'setTitle' do |c|
|
35
|
+
c.flag 'channel_id', desc: 'Channel ID containing the assistant thread.'
|
36
|
+
c.flag 'thread_ts', desc: 'Message timestamp of the thread to set suggested prompts for.'
|
37
|
+
c.flag 'title', desc: 'The title to use for the thread.'
|
38
|
+
c.action do |_global_options, options, _args|
|
39
|
+
puts JSON.dump(@client.assistant_threads_setTitle(options))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/bin/commands/bookmarks.rb
CHANGED
@@ -12,6 +12,7 @@ module Slack
|
|
12
12
|
c.flag 'channel_id', desc: 'Channel to add bookmark in.'
|
13
13
|
c.flag 'title', desc: 'Title for the bookmark.'
|
14
14
|
c.flag 'type', desc: 'Type of the bookmark i.e link.'
|
15
|
+
c.flag 'access_level', desc: "The level that we are setting the file's permission to (read or write)."
|
15
16
|
c.flag 'emoji', desc: 'Emoji tag to apply to the link.'
|
16
17
|
c.flag 'entity_id', desc: 'ID of the entity being bookmarked. Only applies to message and file types.'
|
17
18
|
c.flag 'link', desc: 'Link to bookmark.'
|
data/bin/commands/canvases.rb
CHANGED
@@ -6,8 +6,8 @@ module Slack
|
|
6
6
|
class App
|
7
7
|
desc 'Canvases methods.'
|
8
8
|
command 'canvases' do |g|
|
9
|
-
g.desc 'Create
|
10
|
-
g.long_desc %( Create
|
9
|
+
g.desc 'Create canvas for a user'
|
10
|
+
g.long_desc %( Create canvas for a user )
|
11
11
|
g.command 'create' do |c|
|
12
12
|
c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.'
|
13
13
|
c.flag 'title', desc: 'Title of the newly created canvas.'
|
@@ -16,8 +16,8 @@ module Slack
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
g.desc 'Deletes a canvas
|
20
|
-
g.long_desc %( Deletes a canvas
|
19
|
+
g.desc 'Deletes a canvas'
|
20
|
+
g.long_desc %( Deletes a canvas )
|
21
21
|
g.command 'delete' do |c|
|
22
22
|
c.flag 'canvas_id', desc: 'Encoded ID of the canvas.'
|
23
23
|
c.action do |_global_options, options, _args|
|
@@ -20,10 +20,10 @@ module Slack
|
|
20
20
|
g.desc 'Sets the access level to a canvas for specified entities'
|
21
21
|
g.long_desc %( Sets the access level to a canvas for specified entities )
|
22
22
|
g.command 'set' do |c|
|
23
|
-
c.flag 'access_level', desc: 'Desired level of access
|
23
|
+
c.flag 'access_level', desc: 'Desired level of access.'
|
24
24
|
c.flag 'canvas_id', desc: 'Encoded ID of the canvas.'
|
25
|
-
c.flag 'channel_ids', desc: 'List of channels you wish to update access for.'
|
26
|
-
c.flag 'user_ids', desc: 'List of users you wish to update access for.'
|
25
|
+
c.flag 'channel_ids', desc: 'List of channels you wish to update access for. Can only be used if user_ids is not provided.'
|
26
|
+
c.flag 'user_ids', desc: 'List of users you wish to update access for. Can only be used if channel_ids is not provided.'
|
27
27
|
c.action do |_global_options, options, _args|
|
28
28
|
puts JSON.dump(@client.canvases_access_set(options))
|
29
29
|
end
|
data/bin/commands/chat.rb
CHANGED
@@ -71,6 +71,7 @@ module Slack
|
|
71
71
|
c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url.'
|
72
72
|
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.'
|
73
73
|
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
|
74
|
+
c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters.'
|
74
75
|
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
|
75
76
|
c.flag 'thread_ts', desc: "Provide another message's ts value to post this message in a thread. Avoid using a reply's ts value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread."
|
76
77
|
c.flag 'username', desc: "Set your bot's user name."
|
@@ -82,14 +83,15 @@ module Slack
|
|
82
83
|
g.desc 'Sends a message to a channel.'
|
83
84
|
g.long_desc %( Sends a message to a channel. )
|
84
85
|
g.command 'postMessage' do |c|
|
85
|
-
c.flag 'channel', desc: '
|
86
|
+
c.flag 'channel', desc: 'An encoded ID or channel name that represents a channel, private group, or IM channel to send the message to. See below for more details.'
|
86
87
|
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
87
88
|
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
|
88
89
|
c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
|
89
|
-
c.flag 'as_user', desc: '(Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic
|
90
|
+
c.flag 'as_user', desc: '(Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic apps. See legacy as_user parameter below.'
|
90
91
|
c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url.'
|
91
92
|
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.'
|
92
93
|
c.flag 'link_names', desc: 'Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.'
|
94
|
+
c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters.'
|
93
95
|
c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
|
94
96
|
c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
|
95
97
|
c.flag 'parse', desc: 'Change how messages are treated. See below.'
|
@@ -113,6 +115,7 @@ module Slack
|
|
113
115
|
c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
|
114
116
|
c.flag 'as_user', desc: 'Set to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See chat.postMessage.'
|
115
117
|
c.flag 'link_names', desc: 'Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.'
|
118
|
+
c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters.'
|
116
119
|
c.flag 'metadata', desc: 'JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.'
|
117
120
|
c.flag 'parse', desc: 'Change how messages are treated. See chat.postMessage.'
|
118
121
|
c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
|
@@ -144,7 +147,7 @@ module Slack
|
|
144
147
|
g.desc 'Updates a message.'
|
145
148
|
g.long_desc %( Updates a message. )
|
146
149
|
g.command 'update' do |c|
|
147
|
-
c.flag 'channel', desc: 'Channel containing the message to be updated.'
|
150
|
+
c.flag 'channel', desc: 'Channel containing the message to be updated. For direct messages, ensure that this value is a DM ID (starts with D) instead of a User ID (starts with either U or W).'
|
148
151
|
c.flag 'ts', desc: 'Timestamp of the message to be updated.'
|
149
152
|
c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
|
150
153
|
c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
|
@@ -152,6 +155,7 @@ module Slack
|
|
152
155
|
c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
|
153
156
|
c.flag 'file_ids', desc: 'Array of new file ids that will be sent with this message.'
|
154
157
|
c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.'
|
158
|
+
c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters.'
|
155
159
|
c.flag 'metadata', desc: "JSON object with event_type and event_payload fields, presented as a URL-encoded string. If you don't include this field, the message's previous metadata will be retained. To remove previous metadata, include an empty object for this field. Metadata you post to Slack is accessible to any app or user who is a member of that workspace."
|
156
160
|
c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.'
|
157
161
|
c.flag 'reply_broadcast', desc: 'Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.'
|
@@ -111,7 +111,7 @@ module Slack
|
|
111
111
|
g.command 'inviteShared' do |c|
|
112
112
|
c.flag 'channel', desc: "ID of the channel on your team that you'd like to share."
|
113
113
|
c.flag 'emails', desc: 'Optional email to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.'
|
114
|
-
c.flag 'external_limited', desc: 'Optional boolean on whether invite is to
|
114
|
+
c.flag 'external_limited', desc: 'Optional boolean on whether invite is to an external limited member. Defaults to true.'
|
115
115
|
c.flag 'user_ids', desc: 'Optional user_id to receive this invite. Either emails or user_ids must be provided. Only one email or one user ID may be invited at a time.'
|
116
116
|
c.action do |_global_options, options, _args|
|
117
117
|
puts JSON.dump(@client.conversations_inviteShared(options))
|
@@ -228,11 +228,11 @@ module Slack
|
|
228
228
|
end
|
229
229
|
end
|
230
230
|
|
231
|
-
g.desc 'Sets the
|
232
|
-
g.long_desc %( Sets the
|
231
|
+
g.desc 'Sets the channel description.'
|
232
|
+
g.long_desc %( Sets the channel description. )
|
233
233
|
g.command 'setPurpose' do |c|
|
234
|
-
c.flag 'channel', desc: '
|
235
|
-
c.flag 'purpose', desc: '
|
234
|
+
c.flag 'channel', desc: 'Channel to set the description of.'
|
235
|
+
c.flag 'purpose', desc: 'The description.'
|
236
236
|
c.action do |_global_options, options, _args|
|
237
237
|
puts JSON.dump(@client.conversations_setPurpose(options))
|
238
238
|
end
|