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.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/update_api.yml +1 -1
  3. data/.rubocop_todo.yml +43 -13
  4. data/CHANGELOG.md +12 -0
  5. data/CONTRIBUTING.md +7 -7
  6. data/Gemfile +1 -0
  7. data/README.md +46 -28
  8. data/bin/commands/admin_conversations.rb +21 -0
  9. data/bin/commands/admin_users_session.rb +1 -1
  10. data/bin/commands/admin_workflows.rb +3 -1
  11. data/bin/commands/admin_workflows_triggers_types_permissions.rb +4 -4
  12. data/bin/commands/assistant_threads.rb +45 -0
  13. data/bin/commands/bookmarks.rb +1 -0
  14. data/bin/commands/canvases.rb +4 -4
  15. data/bin/commands/canvases_access.rb +3 -3
  16. data/bin/commands/chat.rb +7 -3
  17. data/bin/commands/conversations.rb +5 -5
  18. data/bin/commands/conversations_canvases.rb +2 -2
  19. data/bin/commands/conversations_requestSharedInvite.rb +48 -0
  20. data/bin/commands/files.rb +2 -1
  21. data/bin/commands/usergroups.rb +5 -0
  22. data/bin/commands/usergroups_users.rb +2 -0
  23. data/examples/files_upload_v2/.env.example +1 -0
  24. data/examples/files_upload_v2/Gemfile +5 -0
  25. data/examples/files_upload_v2/README.md +13 -0
  26. data/examples/files_upload_v2/files_upload_v2.rb +37 -0
  27. data/examples/oauth_v2/.env.example +4 -0
  28. data/examples/oauth_v2/Gemfile +7 -0
  29. data/examples/oauth_v2/README.md +33 -0
  30. data/examples/oauth_v2/oauth_v2.rb +60 -0
  31. data/lib/slack/messages/formatting.rb +1 -1
  32. data/lib/slack/version.rb +1 -1
  33. data/lib/slack/web/api/endpoints/admin_conversations.rb +35 -0
  34. data/lib/slack/web/api/endpoints/admin_users_session.rb +2 -3
  35. data/lib/slack/web/api/endpoints/admin_workflows.rb +5 -1
  36. data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +2 -2
  37. data/lib/slack/web/api/endpoints/assistant_threads.rb +68 -0
  38. data/lib/slack/web/api/endpoints/bookmarks.rb +2 -0
  39. data/lib/slack/web/api/endpoints/canvases.rb +2 -2
  40. data/lib/slack/web/api/endpoints/canvases_access.rb +4 -4
  41. data/lib/slack/web/api/endpoints/chat.rb +12 -3
  42. data/lib/slack/web/api/endpoints/conversations.rb +4 -4
  43. data/lib/slack/web/api/endpoints/conversations_canvases.rb +1 -1
  44. data/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb +73 -0
  45. data/lib/slack/web/api/endpoints/files.rb +3 -1
  46. data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
  47. data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
  48. data/lib/slack/web/api/endpoints.rb +4 -0
  49. data/lib/slack/web/api/errors.rb +48 -4
  50. data/lib/slack/web/api/helpers/files.rb +87 -0
  51. data/lib/slack/web/api/helpers.rb +13 -0
  52. data/lib/slack/web/api/templates/method_spec.erb +4 -3
  53. data/lib/slack/web/client.rb +1 -0
  54. data/lib/slack/web/faraday/connection.rb +13 -26
  55. data/lib/slack/web/faraday/options.rb +24 -0
  56. data/lib/slack/web/faraday/request.rb +2 -1
  57. data/lib/slack-ruby-client.rb +2 -0
  58. data/slack-ruby-client.gemspec +2 -1
  59. metadata +32 -154
  60. data/screenshots/create-app.png +0 -0
  61. data/spec/fixtures/slack/web/429_error.yml +0 -81
  62. data/spec/fixtures/slack/web/auth_test_error.yml +0 -81
  63. data/spec/fixtures/slack/web/auth_test_success.yml +0 -81
  64. data/spec/fixtures/slack/web/conversations_info.yml +0 -167
  65. data/spec/fixtures/slack/web/conversations_setTopic.yml +0 -84
  66. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +0 -172
  67. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +0 -253
  68. data/spec/fixtures/slack/web/paginated_users_list.yml +0 -613
  69. data/spec/fixtures/slack/web/rtm_connect.yml +0 -391
  70. data/spec/fixtures/slack/web/users_info.yml +0 -214
  71. data/spec/fixtures/slack/web/users_list.yml +0 -133
  72. data/spec/fixtures/slack/web/views_open_error.yml +0 -83
  73. data/spec/integration/integration_spec.rb +0 -207
  74. data/spec/slack/config_spec.rb +0 -16
  75. data/spec/slack/events/config_spec.rb +0 -35
  76. data/spec/slack/events/request_spec.rb +0 -199
  77. data/spec/slack/messages/formatting_spec.rb +0 -156
  78. data/spec/slack/real_time/api/message_spec.rb +0 -20
  79. data/spec/slack/real_time/api/ping_spec.rb +0 -17
  80. data/spec/slack/real_time/api/typing_spec.rb +0 -19
  81. data/spec/slack/real_time/client_spec.rb +0 -601
  82. data/spec/slack/real_time/concurrency/clients/async_spec.rb +0 -16
  83. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +0 -21
  84. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +0 -10
  85. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +0 -10
  86. data/spec/slack/real_time/event_handlers/bot_spec.rb +0 -47
  87. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +0 -16
  88. data/spec/slack/real_time/event_handlers/im_spec.rb +0 -51
  89. data/spec/slack/real_time/event_handlers/private_channel_spec.rb +0 -99
  90. data/spec/slack/real_time/event_handlers/public_channel_spec.rb +0 -123
  91. data/spec/slack/real_time/event_handlers/team_spec.rb +0 -63
  92. data/spec/slack/real_time/event_handlers/user_spec.rb +0 -65
  93. data/spec/slack/real_time/rtm_connect_spec.rb +0 -14
  94. data/spec/slack/real_time/stores/store_spec.rb +0 -50
  95. data/spec/slack/slack_spec.rb +0 -93
  96. data/spec/slack/version_spec.rb +0 -8
  97. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +0 -13
  98. data/spec/slack/web/api/endpoints/admin_apps_activities_spec.rb +0 -8
  99. data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +0 -8
  100. data/spec/slack/web/api/endpoints/admin_apps_config_spec.rb +0 -18
  101. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +0 -13
  102. data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +0 -8
  103. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +0 -18
  104. data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +0 -8
  105. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +0 -35
  106. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +0 -38
  107. data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +0 -8
  108. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +0 -32
  109. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +0 -133
  110. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +0 -37
  111. data/spec/slack/web/api/endpoints/admin_functions_permissions_spec.rb +0 -21
  112. data/spec/slack/web/api/endpoints/admin_functions_spec.rb +0 -13
  113. data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +0 -8
  114. data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +0 -8
  115. data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +0 -18
  116. data/spec/slack/web/api/endpoints/admin_roles_spec.rb +0 -30
  117. data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +0 -13
  118. data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +0 -13
  119. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +0 -53
  120. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +0 -16
  121. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +0 -37
  122. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +0 -41
  123. data/spec/slack/web/api/endpoints/admin_users_spec.rb +0 -67
  124. data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +0 -8
  125. data/spec/slack/web/api/endpoints/admin_workflows_collaborators_spec.rb +0 -24
  126. data/spec/slack/web/api/endpoints/admin_workflows_permissions_spec.rb +0 -13
  127. data/spec/slack/web/api/endpoints/admin_workflows_spec.rb +0 -13
  128. data/spec/slack/web/api/endpoints/admin_workflows_triggers_types_permissions_spec.rb +0 -21
  129. data/spec/slack/web/api/endpoints/api_spec.rb +0 -8
  130. data/spec/slack/web/api/endpoints/apps_activities_spec.rb +0 -13
  131. data/spec/slack/web/api/endpoints/apps_auth_external_spec.rb +0 -13
  132. data/spec/slack/web/api/endpoints/apps_connections_spec.rb +0 -8
  133. data/spec/slack/web/api/endpoints/apps_datastore_spec.rb +0 -74
  134. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +0 -13
  135. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +0 -44
  136. data/spec/slack/web/api/endpoints/apps_spec.rb +0 -16
  137. data/spec/slack/web/api/endpoints/auth_spec.rb +0 -8
  138. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +0 -8
  139. data/spec/slack/web/api/endpoints/bookmarks_spec.rb +0 -40
  140. data/spec/slack/web/api/endpoints/bots_spec.rb +0 -8
  141. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +0 -24
  142. data/spec/slack/web/api/endpoints/calls_spec.rb +0 -31
  143. data/spec/slack/web/api/endpoints/canvases_access_spec.rb +0 -21
  144. data/spec/slack/web/api/endpoints/canvases_sections_spec.rb +0 -16
  145. data/spec/slack/web/api/endpoints/canvases_spec.rb +0 -21
  146. data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +0 -8
  147. data/spec/slack/web/api/endpoints/chat_spec.rb +0 -134
  148. data/spec/slack/web/api/endpoints/conversations_canvases_spec.rb +0 -13
  149. data/spec/slack/web/api/endpoints/conversations_externalInvitePermissions_spec.rb +0 -19
  150. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -8
  151. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +0 -27
  152. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +0 -206
  153. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +0 -13
  154. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +0 -40
  155. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +0 -38
  156. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +0 -112
  157. data/spec/slack/web/api/endpoints/dialog_spec.rb +0 -14
  158. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -18
  159. data/spec/slack/web/api/endpoints/emoji_spec.rb +0 -8
  160. data/spec/slack/web/api/endpoints/files_comments_spec.rb +0 -16
  161. data/spec/slack/web/api/endpoints/files_remote_spec.rb +0 -24
  162. data/spec/slack/web/api/endpoints/files_spec.rb +0 -57
  163. data/spec/slack/web/api/endpoints/functions_distributions_permissions_spec.rb +0 -10
  164. data/spec/slack/web/api/endpoints/functions_spec.rb +0 -28
  165. data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +0 -13
  166. data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +0 -13
  167. data/spec/slack/web/api/endpoints/migration_spec.rb +0 -13
  168. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -8
  169. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +0 -16
  170. data/spec/slack/web/api/endpoints/openid_connect_spec.rb +0 -8
  171. data/spec/slack/web/api/endpoints/pins_spec.rb +0 -23
  172. data/spec/slack/web/api/endpoints/reactions_spec.rb +0 -24
  173. data/spec/slack/web/api/endpoints/reminders_spec.rb +0 -31
  174. data/spec/slack/web/api/endpoints/rtm_spec.rb +0 -8
  175. data/spec/slack/web/api/endpoints/search_spec.rb +0 -23
  176. data/spec/slack/web/api/endpoints/stars_spec.rb +0 -8
  177. data/spec/slack/web/api/endpoints/team_billing_spec.rb +0 -8
  178. data/spec/slack/web/api/endpoints/team_externalTeams_spec.rb +0 -13
  179. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +0 -8
  180. data/spec/slack/web/api/endpoints/team_profile_spec.rb +0 -8
  181. data/spec/slack/web/api/endpoints/team_spec.rb +0 -8
  182. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +0 -13
  183. data/spec/slack/web/api/endpoints/usergroups_spec.rb +0 -28
  184. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +0 -21
  185. data/spec/slack/web/api/endpoints/users_admin_spec.rb +0 -18
  186. data/spec/slack/web/api/endpoints/users_discoverableContacts_spec.rb +0 -13
  187. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +0 -8
  188. data/spec/slack/web/api/endpoints/users_profile_spec.rb +0 -14
  189. data/spec/slack/web/api/endpoints/users_spec.rb +0 -8
  190. data/spec/slack/web/api/endpoints/views_spec.rb +0 -65
  191. data/spec/slack/web/api/endpoints/workflows_spec.rb +0 -34
  192. data/spec/slack/web/api/endpoints/workflows_triggers_permissions_spec.rb +0 -31
  193. data/spec/slack/web/api/error_spec.rb +0 -14
  194. data/spec/slack/web/api/errors/slack_error_spec.rb +0 -33
  195. data/spec/slack/web/api/mixins/conversations_list_spec.rb +0 -21
  196. data/spec/slack/web/api/mixins/conversations_spec.rb +0 -45
  197. data/spec/slack/web/api/mixins/users_spec.rb +0 -52
  198. data/spec/slack/web/api/options_spec.rb +0 -69
  199. data/spec/slack/web/api/pagination/cursor_spec.rb +0 -102
  200. data/spec/slack/web/client_spec.rb +0 -359
  201. data/spec/slack/web/faraday/request_spec.rb +0 -80
  202. data/spec/slack/web/faraday/response/raise_error_spec.rb +0 -86
  203. data/spec/spec_helper.rb +0 -30
  204. data/spec/support/queue_with_timeout.rb +0 -35
  205. data/spec/support/real_time/concurrency/mock.rb +0 -31
  206. data/spec/support/real_time/connected_client.rb +0 -21
  207. data/spec/support/real_time/event.rb +0 -12
  208. data/spec/support/real_time/loaded_client.rb +0 -120
  209. data/spec/support/token.rb +0 -11
  210. data/spec/support/vcr.rb +0 -45
@@ -6,8 +6,8 @@ module Slack
6
6
  class App
7
7
  desc 'ConversationsCanvases methods.'
8
8
  command 'conversations_canvases' do |g|
9
- g.desc 'Create a Channel Canvas for a channel.'
10
- g.long_desc %( Create a Channel Canvas for a channel. )
9
+ g.desc 'Create a channel canvas for a channel'
10
+ g.long_desc %( Create a channel canvas for a channel )
11
11
  g.command 'create' do |c|
12
12
  c.flag 'channel_id', desc: 'Channel ID of the channel we create the channel canvas for.'
13
13
  c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.'
@@ -0,0 +1,48 @@
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 'ConversationsRequestsharedinvite methods.'
8
+ command 'conversations_requestSharedInvite' do |g|
9
+ g.desc 'Approves a request to add an external user to a channel and sends them a Slack Connect invite'
10
+ g.long_desc %( Approves a request to add an external user to a channel and sends them a Slack Connect invite )
11
+ g.command 'approve' do |c|
12
+ c.flag 'invite_id', desc: 'ID of the requested shared channel invite to approve.'
13
+ c.flag 'channel_id', desc: 'Optional channel_id to which external user will be invited to. Will override the value on the requested invite.'
14
+ c.flag 'is_external_limited', desc: 'Optional boolean on whether the invited team will have post-only permissions in the channel. Will override the value on the requested invite.'
15
+ c.flag 'message', desc: 'Object describing the text to send along with the invite. If this object is specified, both text and is_override are required properties. If is_override is set to true, text will override the original invitation message. Otherwise, text will be appended to the original invitation message. The total length of the message cannot exceed 560 characters. If is_override is set to false, the length of text and the user specified message on the invite request in total must be less than 560 characters.'
16
+ c.action do |_global_options, options, _args|
17
+ puts JSON.dump(@client.conversations_requestSharedInvite_approve(options))
18
+ end
19
+ end
20
+
21
+ g.desc 'Denies a request to invite an external user to a channel'
22
+ g.long_desc %( Denies a request to invite an external user to a channel )
23
+ g.command 'deny' do |c|
24
+ c.flag 'invite_id', desc: 'ID of the requested shared channel invite to deny.'
25
+ c.flag 'message', desc: 'Optional message explaining why the request to invite was denied.'
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump(@client.conversations_requestSharedInvite_deny(options))
28
+ end
29
+ end
30
+
31
+ g.desc 'Lists requests to add external users to channels with ability to filter.'
32
+ g.long_desc %( Lists requests to add external users to channels with ability to filter. )
33
+ g.command 'list' do |c|
34
+ c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. See pagination for more detail."
35
+ c.flag 'include_approved', desc: 'When true approved invitation requests will be returned, otherwise they will be excluded.'
36
+ c.flag 'include_denied', desc: 'When true denied invitation requests will be returned, otherwise they will be excluded.'
37
+ c.flag 'include_expired', desc: 'When true expired invitation requests will be returned, otherwise they will be excluded.'
38
+ c.flag 'invite_ids', desc: 'An optional list of invitation ids to look up.'
39
+ c.flag 'limit', desc: 'The number of items to return. Must be between 1 - 1000 (inclusive).'
40
+ c.flag 'user_id', desc: 'Optional filter to return invitation requests for the inviting user.'
41
+ c.action do |_global_options, options, _args|
42
+ puts JSON.dump(@client.conversations_requestSharedInvite_list(options))
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -11,8 +11,9 @@ module Slack
11
11
  g.command 'completeUploadExternal' do |c|
12
12
  c.flag 'files', desc: 'Array of file ids and their corresponding (optional) titles.'
13
13
  c.flag 'channel_id', desc: 'Channel ID where the file will be shared. If not specified the file will be private.'
14
+ c.flag 'channels', desc: 'Comma-separated string of channel IDs where the file will be shared.'
14
15
  c.flag 'initial_comment', desc: 'The message text introducing the file in specified channels.'
15
- c.flag 'thread_ts', desc: "Provide another message's ts value to upload this file as a reply. Never use a reply's ts value; use its parent instead."
16
+ c.flag 'thread_ts', desc: "Provide another message's ts value to upload this file as a reply. Never use a reply's ts value; use its parent instead. Also make sure to provide only one channel when using 'thread_ts'."
16
17
  c.action do |_global_options, options, _args|
17
18
  puts JSON.dump(@client.files_completeUploadExternal(options))
18
19
  end
@@ -10,8 +10,10 @@ module Slack
10
10
  g.long_desc %( Create a User Group. )
11
11
  g.command 'create' do |c|
12
12
  c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.'
13
+ c.flag 'additional_channels', desc: 'A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.'
13
14
  c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.'
14
15
  c.flag 'description', desc: 'A short description of the User Group.'
16
+ c.flag 'enable_section', desc: 'Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added.'
15
17
  c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.'
16
18
  c.flag 'include_count', desc: 'Include the number of users in each User Group.'
17
19
  c.flag 'team_id', desc: 'Encoded team id where the user group has to be created, required if org token is used.'
@@ -49,6 +51,7 @@ module Slack
49
51
  c.flag 'include_disabled', desc: 'Include disabled User Groups.'
50
52
  c.flag 'include_users', desc: 'Include the list of users for each User Group.'
51
53
  c.flag 'team_id', desc: 'encoded team id to list user groups in, required if org token is used.'
54
+ c.flag 'usergroup_id', desc: 'The id of the usergroup you would like to filter the results down to.'
52
55
  c.action do |_global_options, options, _args|
53
56
  puts JSON.dump(@client.usergroups_list(options))
54
57
  end
@@ -58,8 +61,10 @@ module Slack
58
61
  g.long_desc %( Update an existing User Group. )
59
62
  g.command 'update' do |c|
60
63
  c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
64
+ c.flag 'additional_channels', desc: 'A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.'
61
65
  c.flag 'channels', desc: 'A comma separated string of encoded channel IDs for which the User Group uses as a default.'
62
66
  c.flag 'description', desc: 'A short description of the User Group.'
67
+ c.flag 'enable_section', desc: 'Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added.'
63
68
  c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.'
64
69
  c.flag 'include_count', desc: 'Include the number of users in the User Group.'
65
70
  c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.'
@@ -22,7 +22,9 @@ module Slack
22
22
  g.command 'update' do |c|
23
23
  c.flag 'usergroup', desc: 'The encoded ID of the user group to update.'
24
24
  c.flag 'users', desc: 'A comma separated string of encoded user IDs that represent the entire list of users for the user group.'
25
+ c.flag 'additional_channels', desc: 'A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too.'
25
26
  c.flag 'include_count', desc: 'Include the number of users in the user group.'
27
+ c.flag 'is_shared', desc: 'Boolean to identify if the API is getting called when a shared section is getting shared.'
26
28
  c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
27
29
  c.action do |_global_options, options, _args|
28
30
  puts JSON.dump(@client.usergroups_users_update(options))
@@ -0,0 +1 @@
1
+ SLACK_API_TOKEN=
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ source 'http://rubygems.org'
3
+
4
+ gem 'dotenv'
5
+ gem 'slack-ruby-client', path: '../..'
@@ -0,0 +1,13 @@
1
+ Samples for using `files_upload_v2`.
2
+
3
+ ## Usage
4
+
5
+ Create a Slack app and obtain a User OAuth Token [here](https://api.slack.com/tutorials/tracks/getting-a-token) or use the [oauth_v2](../oauth_v2) example to obtain a User OAuth Token.
6
+ Make sure to select `files:write` and `files:read` scopes under "User Token Scopes".
7
+
8
+ Create `.env` file with `SLACK_API_TOKEN` or set the `SLACK_API_TOKEN` environment variable.
9
+
10
+ ```
11
+ bundle install
12
+ bundle exec dotenv ruby files_upload_v2.rb
13
+ ```
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ require 'slack-ruby-client'
3
+ require 'securerandom'
4
+
5
+ Slack.configure do |config|
6
+ config.token = ENV['SLACK_API_TOKEN']
7
+ raise 'Missing ENV[SLACK_API_TOKEN]!' unless config.token
8
+ end
9
+
10
+ client = Slack::Web::Client.new
11
+
12
+ auth = client.auth_test
13
+ puts "Connected to team #{auth.team} (#{auth.team_id}) as #{auth.user}."
14
+
15
+ puts client.files_upload_v2(
16
+ filename: 'files_upload_v2.txt',
17
+ content: SecureRandom.hex
18
+ ).files.first.permalink_public
19
+
20
+ puts client.files_upload_v2(
21
+ filename: 'files_upload_v2_to_general_channel.txt',
22
+ content: SecureRandom.hex,
23
+ channel: '#general'
24
+ ).files.first.permalink_public
25
+
26
+ puts client.files_upload_v2(
27
+ filename: 'files_upload_v2_to_general_and_random_channels.txt',
28
+ content: SecureRandom.hex,
29
+ channels: ['#general', '#random']
30
+ ).files.first.permalink_public
31
+
32
+ channel_id = client.conversations_id(channel: '#general')['channel']['id']
33
+ puts client.files_upload_v2(
34
+ filename: 'files_upload_v2_to_general_by_id.txt',
35
+ content: SecureRandom.hex,
36
+ channel_id: channel_id
37
+ ).files.first.permalink_public
@@ -0,0 +1,4 @@
1
+ SLACK_CLIENT_ID=
2
+ SLACK_CLIENT_SECRET=
3
+ REDIRECT_URI=https://...ngrok-free.app
4
+ SCOPE=files:read,files:write,files:write:user
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ source 'http://rubygems.org'
3
+
4
+ gem 'activesupport'
5
+ gem 'dotenv'
6
+ gem 'slack-ruby-client', path: '../..'
7
+ gem 'webrick'
@@ -0,0 +1,33 @@
1
+ Obtain a user OAuth token from Slack.
2
+
3
+ Create a Slack app [here](https://api.slack.com/tutorials/tracks/getting-a-token).
4
+
5
+ The new app has a pre-configured User OAuth Token which you can use for most of the examples.
6
+ However you may want to obtain a token for a different user, which can be accomplished as follows.
7
+
8
+ To test locally use [ngrok](https://ngrok.com/) to expose your local server to the internet.
9
+
10
+ ```sh
11
+ ngrok http 4242
12
+ ```
13
+
14
+ Add the ngrok URL to the app's "Redirect URLs" under "OAuth & Permissions" in the app's settings.
15
+
16
+ Create a `.env` file with the following:
17
+
18
+ ```
19
+ SLACK_CLIENT_ID=[App Client ID]
20
+ SLACK_CLIENT_SECRET=[App Client Secret]
21
+ REDIRECT_URI=[Your ngrok URL, e.g. https://...ngrok-free.app]
22
+ SCOPE=[Bot User OAuth Scopes Requested]
23
+ USER_SCOPE=[User OAuth Token Scopes Requested]
24
+ ```
25
+
26
+ Run the example.
27
+
28
+ ```sh
29
+ bundle install
30
+ bundle exec dotenv ruby oauth_v2.rb
31
+ ```
32
+
33
+ A browser window will open to complete the OAuth flow.
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'dotenv/load'
5
+ require 'webrick'
6
+ require 'slack-ruby-client'
7
+ require 'active_support'
8
+ require 'active_support/core_ext/object/to_query'
9
+
10
+ server = WEBrick::HTTPServer.new(Port: ENV['PORT'] || 4242)
11
+
12
+ trap 'INT' do
13
+ server.shutdown
14
+ end
15
+
16
+ server.mount_proc '/' do |req, res|
17
+ client = Slack::Web::Client.new
18
+
19
+ response = client.oauth_v2_access(
20
+ req.query.merge(
21
+ client_id: ENV['SLACK_CLIENT_ID'],
22
+ client_secret: ENV['SLACK_CLIENT_SECRET'],
23
+ grant_type: 'authorization_code'
24
+ )
25
+ )
26
+
27
+ pp response
28
+
29
+ res.body = %(
30
+ <html>
31
+ <body>
32
+ <ul>
33
+ <li>bot access_token: #{response.access_token}</li>
34
+ <li>token_type: #{response.token_type}</li>
35
+ <li>app_id: #{response.app_id}</li>
36
+ <li>scope: #{response.scope}</li>
37
+ <li>user: #{response.authed_user.id}</li>
38
+ <li>user access token: #{response.authed_user.access_token}</li>
39
+ </ul>
40
+ <body>
41
+ </html>
42
+ )
43
+
44
+ pp Slack::Web::Client.new(token: response.authed_user.access_token || response.access_token).auth_test
45
+
46
+ server.shutdown
47
+ end
48
+
49
+ query = {
50
+ client_id: ENV['SLACK_CLIENT_ID'],
51
+ redirect_uri: ENV['REDIRECT_URI'],
52
+ scope: ENV['SCOPE'],
53
+ user_scope: ENV['USER_SCOPE']
54
+ }
55
+
56
+ url = "https://slack.com/oauth/v2/authorize?#{query.to_query}"
57
+ puts "Opening browser at #{url}."
58
+ system 'open', url
59
+
60
+ server.start
@@ -75,7 +75,7 @@ module Slack
75
75
  #
76
76
  def markdown(text)
77
77
  text
78
- .gsub(/(?<!\*)\*([^*]+)\*(?!\*)/, '_\1_') # italic
78
+ .gsub(/(?<!\*)\*([^*\n]+)\*(?!\*)/, '_\1_') # italic
79
79
  .gsub(/\*\*\*(.*?)\*\*\*/, '*_\1_*') # bold & italic
80
80
  .gsub(/\*\*(.*?)\*\*/, '*\1*') # bold
81
81
  .gsub(/~~(.*?)~~/, '~\1~') # strikethrough
data/lib/slack/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Slack
3
- VERSION = '2.4.0'
3
+ VERSION = '2.5.0'
4
4
  end
@@ -191,6 +191,25 @@ module Slack
191
191
  post('admin.conversations.invite', options)
192
192
  end
193
193
 
194
+ #
195
+ # Link a Salesforce record to a channel
196
+ #
197
+ # @option options [channel] :channel
198
+ # Channel ID for Slack channel that will be linked to a Salesforce record.
199
+ # @option options [string] :record_id
200
+ # Salesforce record ID (15 or 18 digit accepted). See here for how to look up record ID.
201
+ # @option options [string] :salesforce_org_id
202
+ # Salesforce org ID (15 or 18 digit accepted). See here for how to look up Salesforce org ID.
203
+ # @see https://api.slack.com/methods/admin.conversations.linkObjects
204
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.linkObjects.json
205
+ def admin_conversations_linkObjects(options = {})
206
+ raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
207
+ raise ArgumentError, 'Required arguments :record_id missing' if options[:record_id].nil?
208
+ raise ArgumentError, 'Required arguments :salesforce_org_id missing' if options[:salesforce_org_id].nil?
209
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
210
+ post('admin.conversations.linkObjects', options)
211
+ end
212
+
194
213
  #
195
214
  # Returns channels on the given team using the filters.
196
215
  #
@@ -338,6 +357,22 @@ module Slack
338
357
  raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
339
358
  post('admin.conversations.unarchive', options)
340
359
  end
360
+
361
+ #
362
+ # Unlink a Salesforce record from a channel
363
+ #
364
+ # @option options [channel] :channel
365
+ # Channel ID for Slack channel that will be unlinked from the Salesforce record.
366
+ # @option options [string] :new_name
367
+ # Channel name you would like to give to the channel that is being unlinked from the Salesforce record.
368
+ # @see https://api.slack.com/methods/admin.conversations.unlinkObjects
369
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations/admin.conversations.unlinkObjects.json
370
+ def admin_conversations_unlinkObjects(options = {})
371
+ raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
372
+ raise ArgumentError, 'Required arguments :new_name missing' if options[:new_name].nil?
373
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
374
+ post('admin.conversations.unlinkObjects', options)
375
+ end
341
376
  end
342
377
  end
343
378
  end
@@ -35,13 +35,12 @@ module Slack
35
35
  #
36
36
  # @option options [integer] :session_id
37
37
  # ID of the session to invalidate.
38
- # @option options [string] :team_id
39
- # ID of the workspace that the session belongs to.
38
+ # @option options [Object] :user_id
39
+ # ID of the user that the session belongs to.
40
40
  # @see https://api.slack.com/methods/admin.users.session.invalidate
41
41
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.invalidate.json
42
42
  def admin_users_session_invalidate(options = {})
43
43
  raise ArgumentError, 'Required arguments :session_id missing' if options[:session_id].nil?
44
- raise ArgumentError, 'Required arguments :team_id missing' if options[:team_id].nil?
45
44
  post('admin.users.session.invalidate', options)
46
45
  end
47
46
 
@@ -12,7 +12,7 @@ module Slack
12
12
  # @option options [Object] :app_id
13
13
  # The parent app ID for which to return workflows.
14
14
  # @option options [array] :collaborator_ids
15
- # Only include workflows where the provided user IDs are a manager/collaborator of that workflow.
15
+ # Only include workflows where all of the provided user IDs are a manager/collaborator of that workflow.
16
16
  # @option options [string] :cursor
17
17
  # Set cursor to next_cursor returned by the previous call to list items in the next page.
18
18
  # @option options [boolean] :is_sales_elevate
@@ -23,6 +23,8 @@ module Slack
23
23
  # Only include workflows with no collaborators in the result; default is false.
24
24
  # @option options [integer] :num_trigger_ids
25
25
  # Number of trigger IDs to fetch for each workflow; default is 10.
26
+ # @option options [enum] :publish_status
27
+ # Filter workflows by their published status.
26
28
  # @option options [string] :query
27
29
  # A search query to filter for workflow name or description.
28
30
  # @option options [enum] :sort
@@ -31,6 +33,8 @@ module Slack
31
33
  # 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).
32
34
  # @option options [enum] :source
33
35
  # Source of workflow creation, either from code or workflow builder.
36
+ # @option options [array] :step_function_ids
37
+ # Only include workflows that use all of the provided step function ids.
34
38
  # @option options [string] :trigger_type_id
35
39
  # Only include workflows with this trigger type.
36
40
  # @see https://api.slack.com/methods/admin.workflows.search
@@ -7,7 +7,7 @@ module Slack
7
7
  module Endpoints
8
8
  module AdminWorkflowsTriggersTypesPermissions
9
9
  #
10
- # list the permissions for using each trigger type in workflow builder
10
+ # list the permissions for using each trigger type
11
11
  #
12
12
  # @option options [array] :trigger_type_ids
13
13
  # The trigger types IDs for which to get the permissions.
@@ -19,7 +19,7 @@ module Slack
19
19
  end
20
20
 
21
21
  #
22
- # Set the permissions for using a trigger type in workflow builder
22
+ # Set the permissions for using a trigger type
23
23
  #
24
24
  # @option options [Object] :id
25
25
  # The trigger type ID for which to set the permissions.
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ module Slack
5
+ module Web
6
+ module Api
7
+ module Endpoints
8
+ module AssistantThreads
9
+ #
10
+ # Set the status for an AI assistant thread.
11
+ #
12
+ # @option options [Object] :channel_id
13
+ # Channel ID containing the assistant thread.
14
+ # @option options [string] :status
15
+ # Status of the specified bot user, e.g. 'is thinking...'.
16
+ # @option options [string] :thread_ts
17
+ # Message timestamp of the thread of where to set the status.
18
+ # @see https://api.slack.com/methods/assistant.threads.setStatus
19
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/assistant.threads/assistant.threads.setStatus.json
20
+ def assistant_threads_setStatus(options = {})
21
+ raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
22
+ raise ArgumentError, 'Required arguments :status missing' if options[:status].nil?
23
+ raise ArgumentError, 'Required arguments :thread_ts missing' if options[:thread_ts].nil?
24
+ post('assistant.threads.setStatus', options)
25
+ end
26
+
27
+ #
28
+ # Set suggested prompts for the given assistant thread
29
+ #
30
+ # @option options [Object] :channel_id
31
+ # Channel ID containing the assistant thread.
32
+ # @option options [Object] :prompts
33
+ # Each prompt should be supplied with its title and message attribute.
34
+ # @option options [string] :thread_ts
35
+ # Message timestamp of the thread to set suggested prompts for.
36
+ # @option options [string] :title
37
+ # Title for the list of provided prompts. For example: Suggested Prompts, Related Questions.
38
+ # @see https://api.slack.com/methods/assistant.threads.setSuggestedPrompts
39
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/assistant.threads/assistant.threads.setSuggestedPrompts.json
40
+ def assistant_threads_setSuggestedPrompts(options = {})
41
+ raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
42
+ raise ArgumentError, 'Required arguments :prompts missing' if options[:prompts].nil?
43
+ raise ArgumentError, 'Required arguments :thread_ts missing' if options[:thread_ts].nil?
44
+ post('assistant.threads.setSuggestedPrompts', options)
45
+ end
46
+
47
+ #
48
+ # Set the title for the given assistant thread
49
+ #
50
+ # @option options [Object] :channel_id
51
+ # Channel ID containing the assistant thread.
52
+ # @option options [string] :thread_ts
53
+ # Message timestamp of the thread to set suggested prompts for.
54
+ # @option options [string] :title
55
+ # The title to use for the thread.
56
+ # @see https://api.slack.com/methods/assistant.threads.setTitle
57
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/assistant.threads/assistant.threads.setTitle.json
58
+ def assistant_threads_setTitle(options = {})
59
+ raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
60
+ raise ArgumentError, 'Required arguments :thread_ts missing' if options[:thread_ts].nil?
61
+ raise ArgumentError, 'Required arguments :title missing' if options[:title].nil?
62
+ post('assistant.threads.setTitle', options)
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -15,6 +15,8 @@ module Slack
15
15
  # Title for the bookmark.
16
16
  # @option options [string] :type
17
17
  # Type of the bookmark i.e link.
18
+ # @option options [enum] :access_level
19
+ # The level that we are setting the file's permission to (read or write).
18
20
  # @option options [string] :emoji
19
21
  # Emoji tag to apply to the link.
20
22
  # @option options [string] :entity_id
@@ -7,7 +7,7 @@ module Slack
7
7
  module Endpoints
8
8
  module Canvases
9
9
  #
10
- # Create Canvas for a user.
10
+ # Create canvas for a user
11
11
  #
12
12
  # @option options [Object] :document_content
13
13
  # Structure describing the type and value of the content to create.
@@ -20,7 +20,7 @@ module Slack
20
20
  end
21
21
 
22
22
  #
23
- # Deletes a canvas.
23
+ # Deletes a canvas
24
24
  #
25
25
  # @option options [Object] :canvas_id
26
26
  # Encoded ID of the canvas.
@@ -25,14 +25,14 @@ module Slack
25
25
  #
26
26
  # Sets the access level to a canvas for specified entities
27
27
  #
28
- # @option options [Object] :access_level
29
- # Desired level of access (e.g. read, write).
28
+ # @option options [enum] :access_level
29
+ # Desired level of access.
30
30
  # @option options [Object] :canvas_id
31
31
  # Encoded ID of the canvas.
32
32
  # @option options [array] :channel_ids
33
- # List of channels you wish to update access for.
33
+ # List of channels you wish to update access for. Can only be used if user_ids is not provided.
34
34
  # @option options [array] :user_ids
35
- # List of users you wish to update access for.
35
+ # List of users you wish to update access for. Can only be used if channel_ids is not provided.
36
36
  # @see https://api.slack.com/methods/canvases.access.set
37
37
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/canvases.access/canvases.access.set.json
38
38
  def canvases_access_set(options = {})
@@ -112,6 +112,8 @@ module Slack
112
112
  # URL to an image to use as the icon for this message.
113
113
  # @option options [boolean] :link_names
114
114
  # Find and link channel names and usernames.
115
+ # @option options [string] :markdown_text
116
+ # 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.
115
117
  # @option options [string] :parse
116
118
  # Change how messages are treated. Defaults to none. See below.
117
119
  # @option options [string] :thread_ts
@@ -133,7 +135,7 @@ module Slack
133
135
  # Sends a message to a channel.
134
136
  #
135
137
  # @option options [channel] :channel
136
- # Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.
138
+ # 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.
137
139
  # @option options [string] :attachments
138
140
  # A JSON-based array of structured attachments, presented as a URL-encoded string.
139
141
  # @option options [blocks[] as string] :blocks
@@ -141,13 +143,15 @@ module Slack
141
143
  # @option options [string] :text
142
144
  # How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
143
145
  # @option options [boolean] :as_user
144
- # (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 Slack apps. See authorship below.
146
+ # (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.
145
147
  # @option options [string] :icon_emoji
146
148
  # Emoji to use as the icon for this message. Overrides icon_url.
147
149
  # @option options [string] :icon_url
148
150
  # URL to an image to use as the icon for this message.
149
151
  # @option options [boolean] :link_names
150
152
  # Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.
153
+ # @option options [string] :markdown_text
154
+ # 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.
151
155
  # @option options [string] :metadata
152
156
  # 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.
153
157
  # @option options [boolean] :mrkdwn
@@ -169,6 +173,7 @@ module Slack
169
173
  def chat_postMessage(options = {})
170
174
  raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
171
175
  raise ArgumentError, 'At least one of :attachments, :blocks, :text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil?
176
+ options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
172
177
  options = encode_options_as_json(options, %i[attachments blocks metadata])
173
178
  post('chat.postMessage', options)
174
179
  end
@@ -190,6 +195,8 @@ module Slack
190
195
  # 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.
191
196
  # @option options [boolean] :link_names
192
197
  # Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.
198
+ # @option options [string] :markdown_text
199
+ # 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.
193
200
  # @option options [string] :metadata
194
201
  # 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.
195
202
  # @option options [enum] :parse
@@ -248,7 +255,7 @@ module Slack
248
255
  # Updates a message.
249
256
  #
250
257
  # @option options [channel] :channel
251
- # Channel containing the message to be updated.
258
+ # 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).
252
259
  # @option options [timestamp] :ts
253
260
  # Timestamp of the message to be updated.
254
261
  # @option options [string] :attachments
@@ -263,6 +270,8 @@ module Slack
263
270
  # Array of new file ids that will be sent with this message.
264
271
  # @option options [boolean] :link_names
265
272
  # Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.
273
+ # @option options [string] :markdown_text
274
+ # 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.
266
275
  # @option options [string] :metadata
267
276
  # 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.
268
277
  # @option options [string] :parse
@@ -172,7 +172,7 @@ module Slack
172
172
  # @option options [array] :emails
173
173
  # 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.
174
174
  # @option options [boolean] :external_limited
175
- # Optional boolean on whether invite is to a external limited member. Defaults to true.
175
+ # Optional boolean on whether invite is to an external limited member. Defaults to true.
176
176
  # @option options [array] :user_ids
177
177
  # 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.
178
178
  # @see https://api.slack.com/methods/conversations.inviteShared
@@ -378,12 +378,12 @@ module Slack
378
378
  end
379
379
 
380
380
  #
381
- # Sets the purpose for a conversation.
381
+ # Sets the channel description.
382
382
  #
383
383
  # @option options [channel] :channel
384
- # Conversation to set the purpose of.
384
+ # Channel to set the description of.
385
385
  # @option options [string] :purpose
386
- # A new, specialer purpose.
386
+ # The description.
387
387
  # @see https://api.slack.com/methods/conversations.setPurpose
388
388
  # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.setPurpose.json
389
389
  def conversations_setPurpose(options = {})
@@ -7,7 +7,7 @@ module Slack
7
7
  module Endpoints
8
8
  module ConversationsCanvases
9
9
  #
10
- # Create a Channel Canvas for a channel.
10
+ # Create a channel canvas for a channel
11
11
  #
12
12
  # @option options [string] :channel_id
13
13
  # Channel ID of the channel we create the channel canvas for.