slack-ruby-client 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +0 -0
  3. data/.github/FUNDING.yml +0 -0
  4. data/.github/dependabot.yml +0 -0
  5. data/.github/prompts/changelog-entries.prompt.yml +32 -0
  6. data/.github/workflows/danger-comment.yml +11 -2
  7. data/.github/workflows/danger.yml +10 -2
  8. data/.github/workflows/lint.yml +21 -6
  9. data/.github/workflows/release.yml +27 -0
  10. data/.github/workflows/test.yml +0 -0
  11. data/.github/workflows/update_api.yml +86 -6
  12. data/.gitignore +1 -0
  13. data/.gitmodules +0 -0
  14. data/.rspec +0 -0
  15. data/.rubocop.yml +94 -1
  16. data/.rubocop_todo.yml +13 -2
  17. data/.ruby-version +0 -0
  18. data/.spellcheck.txt +256 -0
  19. data/AGENTS.md +12 -0
  20. data/CHANGELOG.md +50 -0
  21. data/CONTRIBUTING.md +59 -59
  22. data/Dangerfile +0 -0
  23. data/Gemfile +33 -5
  24. data/LICENSE.md +1 -1
  25. data/README.md +139 -104
  26. data/RELEASING.md +20 -58
  27. data/Rakefile +29 -3
  28. data/SECURITY.md +1 -1
  29. data/UPGRADING.md +48 -40
  30. data/benchmarks/events.rb +26 -0
  31. data/benchmarks/formatting.rb +17 -0
  32. data/benchmarks/support.rb +67 -0
  33. data/benchmarks/web_client.rb +28 -0
  34. data/bin/commands/admin_analytics.rb +0 -0
  35. data/bin/commands/admin_analytics_members.rb +39 -0
  36. data/bin/commands/admin_analytics_messages.rb +4 -4
  37. data/bin/commands/admin_analytics_slackbot.rb +33 -0
  38. data/bin/commands/admin_apps.rb +0 -0
  39. data/bin/commands/admin_apps_activities.rb +0 -0
  40. data/bin/commands/admin_apps_approved.rb +0 -0
  41. data/bin/commands/admin_apps_config.rb +0 -0
  42. data/bin/commands/admin_apps_mcp_servers.rb +21 -0
  43. data/bin/commands/admin_apps_mcp_servers_permissions.rb +33 -0
  44. data/bin/commands/admin_apps_permissions.rb +58 -0
  45. data/bin/commands/admin_apps_requests.rb +0 -0
  46. data/bin/commands/admin_apps_restricted.rb +0 -0
  47. data/bin/commands/admin_audit_anomaly_allow.rb +0 -0
  48. data/bin/commands/admin_auth_policy.rb +0 -0
  49. data/bin/commands/admin_barriers.rb +0 -0
  50. data/bin/commands/admin_conversations.rb +23 -3
  51. data/bin/commands/admin_conversations_ekm.rb +0 -0
  52. data/bin/commands/admin_conversations_restrictAccess.rb +0 -0
  53. data/bin/commands/admin_emoji.rb +0 -0
  54. data/bin/commands/admin_functions.rb +1 -1
  55. data/bin/commands/admin_functions_permissions.rb +0 -0
  56. data/bin/commands/admin_inviteRequests.rb +0 -0
  57. data/bin/commands/admin_inviteRequests_approved.rb +0 -0
  58. data/bin/commands/admin_inviteRequests_denied.rb +0 -0
  59. data/bin/commands/admin_roles.rb +0 -0
  60. data/bin/commands/admin_slackbot_skills.rb +56 -0
  61. data/bin/commands/admin_teams.rb +0 -0
  62. data/bin/commands/admin_teams_admins.rb +0 -0
  63. data/bin/commands/admin_teams_owners.rb +0 -0
  64. data/bin/commands/admin_teams_settings.rb +0 -0
  65. data/bin/commands/admin_usergroups.rb +74 -0
  66. data/bin/commands/admin_users.rb +11 -2
  67. data/bin/commands/admin_users_access.rb +31 -0
  68. data/bin/commands/admin_users_session.rb +0 -1
  69. data/bin/commands/admin_users_unsupportedVersions.rb +0 -0
  70. data/bin/commands/admin_workflows.rb +0 -0
  71. data/bin/commands/admin_workflows_collaborators.rb +0 -0
  72. data/bin/commands/admin_workflows_permissions.rb +0 -0
  73. data/bin/commands/admin_workflows_triggers_types_permissions.rb +0 -0
  74. data/bin/commands/agents_conversations.rb +122 -0
  75. data/bin/commands/agents_sessions.rb +38 -0
  76. data/bin/commands/api.rb +0 -0
  77. data/bin/commands/apps.rb +0 -0
  78. data/bin/commands/apps_activities.rb +0 -0
  79. data/bin/commands/apps_auth_external.rb +0 -0
  80. data/bin/commands/apps_connections.rb +0 -0
  81. data/bin/commands/apps_datastore.rb +0 -0
  82. data/bin/commands/apps_event_authorizations.rb +0 -0
  83. data/bin/commands/apps_icon.rb +0 -0
  84. data/bin/commands/apps_managed_permissions.rb +21 -0
  85. data/bin/commands/apps_manifest.rb +0 -0
  86. data/bin/commands/apps_user_connection.rb +0 -0
  87. data/bin/commands/assistant_search.rb +0 -0
  88. data/bin/commands/assistant_threads.rb +1 -1
  89. data/bin/commands/auth.rb +0 -0
  90. data/bin/commands/auth_teams.rb +0 -0
  91. data/bin/commands/blocks.rb +0 -0
  92. data/bin/commands/bookmarks.rb +0 -0
  93. data/bin/commands/bots.rb +0 -0
  94. data/bin/commands/calls.rb +0 -0
  95. data/bin/commands/calls_participants.rb +0 -0
  96. data/bin/commands/canvases.rb +12 -2
  97. data/bin/commands/canvases_access.rb +0 -0
  98. data/bin/commands/canvases_sections.rb +0 -0
  99. data/bin/commands/chat.rb +10 -7
  100. data/bin/commands/chat_scheduledMessages.rb +0 -0
  101. data/bin/commands/conversations.rb +1 -1
  102. data/bin/commands/conversations_canvases.rb +1 -1
  103. data/bin/commands/conversations_externalInvitePermissions.rb +0 -0
  104. data/bin/commands/conversations_requestSharedInvite.rb +0 -0
  105. data/bin/commands/dialog.rb +0 -0
  106. data/bin/commands/dnd.rb +0 -0
  107. data/bin/commands/emoji.rb +0 -0
  108. data/bin/commands/entity.rb +27 -0
  109. data/bin/commands/files.rb +3 -0
  110. data/bin/commands/files_comments.rb +0 -0
  111. data/bin/commands/files_remote.rb +0 -0
  112. data/bin/commands/functions.rb +0 -0
  113. data/bin/commands/functions_distributions_permissions.rb +0 -0
  114. data/bin/commands/functions_workflows_steps.rb +0 -0
  115. data/bin/commands/functions_workflows_steps_responses.rb +0 -0
  116. data/bin/commands/migration.rb +0 -0
  117. data/bin/commands/oauth.rb +0 -0
  118. data/bin/commands/oauth_v2.rb +21 -0
  119. data/bin/commands/oauth_v2_user.rb +0 -0
  120. data/bin/commands/openid_connect.rb +0 -0
  121. data/bin/commands/pins.rb +1 -1
  122. data/bin/commands/reactions.rb +0 -0
  123. data/bin/commands/reminders.rb +0 -0
  124. data/bin/commands/rtm.rb +0 -0
  125. data/bin/commands/search.rb +0 -0
  126. data/bin/commands/slackLists.rb +0 -0
  127. data/bin/commands/slackLists_access.rb +0 -0
  128. data/bin/commands/slackLists_download.rb +7 -0
  129. data/bin/commands/slackLists_items.rb +2 -1
  130. data/bin/commands/slackbot_skills.rb +71 -0
  131. data/bin/commands/slackbot_skills_library.rb +29 -0
  132. data/bin/commands/stars.rb +0 -0
  133. data/bin/commands/team.rb +1 -0
  134. data/bin/commands/team_billing.rb +0 -0
  135. data/bin/commands/team_externalTeams.rb +1 -1
  136. data/bin/commands/team_preferences.rb +0 -0
  137. data/bin/commands/team_profile.rb +0 -0
  138. data/bin/commands/tooling_tokens.rb +0 -0
  139. data/bin/commands/usergroups.rb +0 -0
  140. data/bin/commands/usergroups_users.rb +0 -0
  141. data/bin/commands/users.rb +1 -0
  142. data/bin/commands/users_admin.rb +0 -0
  143. data/bin/commands/users_discoverableContacts.rb +0 -0
  144. data/bin/commands/users_prefs.rb +0 -0
  145. data/bin/commands/users_profile.rb +0 -0
  146. data/bin/commands/views.rb +0 -0
  147. data/bin/commands/workflows_featured.rb +0 -0
  148. data/bin/commands/workflows_triggers_permissions.rb +0 -0
  149. data/bin/slack +5 -1
  150. data/examples/files_upload_v2/.env.example +0 -0
  151. data/examples/files_upload_v2/Gemfile +0 -0
  152. data/examples/files_upload_v2/README.md +4 -3
  153. data/examples/files_upload_v2/files_upload_v2.rb +1 -1
  154. data/examples/hi_web/Gemfile +0 -0
  155. data/examples/hi_web/hi.gif +0 -0
  156. data/examples/hi_web/hi.rb +1 -1
  157. data/examples/new_ticket/Gemfile +0 -0
  158. data/examples/new_ticket/new_ticket.rb +1 -1
  159. data/examples/oauth_v2/.env.example +0 -0
  160. data/examples/oauth_v2/Gemfile +0 -0
  161. data/examples/oauth_v2/README.md +5 -4
  162. data/examples/oauth_v2/oauth_v2.rb +6 -6
  163. data/lib/slack/config.rb +0 -0
  164. data/lib/slack/events/config.rb +1 -1
  165. data/lib/slack/events/request.rb +2 -2
  166. data/lib/slack/logger.rb +0 -0
  167. data/lib/slack/messages/formatting.rb +29 -20
  168. data/lib/slack/messages/message.rb +0 -0
  169. data/lib/slack/utils/security.rb +0 -0
  170. data/lib/slack/version.rb +1 -1
  171. data/lib/slack/web/api/endpoints/admin_analytics.rb +0 -0
  172. data/lib/slack/web/api/endpoints/admin_analytics_members.rb +66 -0
  173. data/lib/slack/web/api/endpoints/admin_analytics_messages.rb +3 -3
  174. data/lib/slack/web/api/endpoints/admin_analytics_slackbot.rb +54 -0
  175. data/lib/slack/web/api/endpoints/admin_apps.rb +0 -0
  176. data/lib/slack/web/api/endpoints/admin_apps_activities.rb +0 -0
  177. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +0 -0
  178. data/lib/slack/web/api/endpoints/admin_apps_config.rb +0 -0
  179. data/lib/slack/web/api/endpoints/admin_apps_mcp_servers.rb +31 -0
  180. data/lib/slack/web/api/endpoints/admin_apps_mcp_servers_permissions.rb +46 -0
  181. data/lib/slack/web/api/endpoints/admin_apps_permissions.rb +83 -0
  182. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +0 -0
  183. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +0 -0
  184. data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +0 -0
  185. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +0 -0
  186. data/lib/slack/web/api/endpoints/admin_barriers.rb +0 -0
  187. data/lib/slack/web/api/endpoints/admin_conversations.rb +32 -2
  188. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +0 -0
  189. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +0 -0
  190. data/lib/slack/web/api/endpoints/admin_emoji.rb +0 -1
  191. data/lib/slack/web/api/endpoints/admin_functions.rb +1 -1
  192. data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +0 -0
  193. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +0 -0
  194. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +0 -0
  195. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +0 -0
  196. data/lib/slack/web/api/endpoints/admin_roles.rb +0 -0
  197. data/lib/slack/web/api/endpoints/admin_slackbot_skills.rb +84 -0
  198. data/lib/slack/web/api/endpoints/admin_teams.rb +0 -0
  199. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +0 -0
  200. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +0 -0
  201. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +0 -0
  202. data/lib/slack/web/api/endpoints/admin_usergroups.rb +111 -0
  203. data/lib/slack/web/api/endpoints/admin_users.rb +14 -1
  204. data/lib/slack/web/api/endpoints/admin_users_access.rb +40 -0
  205. data/lib/slack/web/api/endpoints/admin_users_session.rb +0 -2
  206. data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +0 -0
  207. data/lib/slack/web/api/endpoints/admin_workflows.rb +0 -0
  208. data/lib/slack/web/api/endpoints/admin_workflows_collaborators.rb +0 -0
  209. data/lib/slack/web/api/endpoints/admin_workflows_permissions.rb +0 -0
  210. data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +0 -0
  211. data/lib/slack/web/api/endpoints/agents_conversations.rb +186 -0
  212. data/lib/slack/web/api/endpoints/agents_sessions.rb +54 -0
  213. data/lib/slack/web/api/endpoints/api.rb +0 -0
  214. data/lib/slack/web/api/endpoints/apps.rb +0 -0
  215. data/lib/slack/web/api/endpoints/apps_activities.rb +0 -0
  216. data/lib/slack/web/api/endpoints/apps_auth_external.rb +0 -0
  217. data/lib/slack/web/api/endpoints/apps_connections.rb +0 -0
  218. data/lib/slack/web/api/endpoints/apps_datastore.rb +0 -0
  219. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +0 -0
  220. data/lib/slack/web/api/endpoints/apps_icon.rb +0 -0
  221. data/lib/slack/web/api/endpoints/apps_managed_permissions.rb +27 -0
  222. data/lib/slack/web/api/endpoints/apps_manifest.rb +0 -0
  223. data/lib/slack/web/api/endpoints/apps_user_connection.rb +0 -0
  224. data/lib/slack/web/api/endpoints/assistant_search.rb +0 -0
  225. data/lib/slack/web/api/endpoints/assistant_threads.rb +1 -1
  226. data/lib/slack/web/api/endpoints/auth.rb +0 -0
  227. data/lib/slack/web/api/endpoints/auth_teams.rb +0 -0
  228. data/lib/slack/web/api/endpoints/blocks.rb +0 -0
  229. data/lib/slack/web/api/endpoints/bookmarks.rb +0 -0
  230. data/lib/slack/web/api/endpoints/bots.rb +0 -0
  231. data/lib/slack/web/api/endpoints/calls.rb +0 -0
  232. data/lib/slack/web/api/endpoints/calls_participants.rb +0 -0
  233. data/lib/slack/web/api/endpoints/canvases.rb +16 -2
  234. data/lib/slack/web/api/endpoints/canvases_access.rb +0 -0
  235. data/lib/slack/web/api/endpoints/canvases_sections.rb +0 -0
  236. data/lib/slack/web/api/endpoints/chat.rb +14 -10
  237. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +0 -0
  238. data/lib/slack/web/api/endpoints/conversations.rb +1 -1
  239. data/lib/slack/web/api/endpoints/conversations_canvases.rb +1 -1
  240. data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +0 -0
  241. data/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb +0 -0
  242. data/lib/slack/web/api/endpoints/dialog.rb +0 -0
  243. data/lib/slack/web/api/endpoints/dnd.rb +0 -0
  244. data/lib/slack/web/api/endpoints/emoji.rb +0 -0
  245. data/lib/slack/web/api/endpoints/entity.rb +48 -0
  246. data/lib/slack/web/api/endpoints/files.rb +7 -0
  247. data/lib/slack/web/api/endpoints/files_comments.rb +0 -0
  248. data/lib/slack/web/api/endpoints/files_remote.rb +0 -0
  249. data/lib/slack/web/api/endpoints/functions.rb +0 -0
  250. data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +0 -0
  251. data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +0 -0
  252. data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +0 -0
  253. data/lib/slack/web/api/endpoints/migration.rb +0 -0
  254. data/lib/slack/web/api/endpoints/oauth.rb +0 -0
  255. data/lib/slack/web/api/endpoints/oauth_v2.rb +33 -0
  256. data/lib/slack/web/api/endpoints/oauth_v2_user.rb +0 -0
  257. data/lib/slack/web/api/endpoints/openid_connect.rb +0 -0
  258. data/lib/slack/web/api/endpoints/pins.rb +1 -1
  259. data/lib/slack/web/api/endpoints/reactions.rb +0 -0
  260. data/lib/slack/web/api/endpoints/reminders.rb +0 -0
  261. data/lib/slack/web/api/endpoints/rtm.rb +0 -0
  262. data/lib/slack/web/api/endpoints/search.rb +0 -0
  263. data/lib/slack/web/api/endpoints/slackLists.rb +0 -0
  264. data/lib/slack/web/api/endpoints/slackLists_access.rb +0 -0
  265. data/lib/slack/web/api/endpoints/slackLists_download.rb +14 -0
  266. data/lib/slack/web/api/endpoints/slackLists_items.rb +3 -1
  267. data/lib/slack/web/api/endpoints/slackbot_skills.rb +107 -0
  268. data/lib/slack/web/api/endpoints/slackbot_skills_library.rb +36 -0
  269. data/lib/slack/web/api/endpoints/stars.rb +0 -0
  270. data/lib/slack/web/api/endpoints/team.rb +2 -0
  271. data/lib/slack/web/api/endpoints/team_billing.rb +0 -0
  272. data/lib/slack/web/api/endpoints/team_externalTeams.rb +1 -1
  273. data/lib/slack/web/api/endpoints/team_preferences.rb +0 -0
  274. data/lib/slack/web/api/endpoints/team_profile.rb +0 -0
  275. data/lib/slack/web/api/endpoints/tooling_tokens.rb +0 -0
  276. data/lib/slack/web/api/endpoints/usergroups.rb +0 -0
  277. data/lib/slack/web/api/endpoints/usergroups_users.rb +0 -0
  278. data/lib/slack/web/api/endpoints/users.rb +2 -1
  279. data/lib/slack/web/api/endpoints/users_admin.rb +0 -0
  280. data/lib/slack/web/api/endpoints/users_discoverableContacts.rb +0 -0
  281. data/lib/slack/web/api/endpoints/users_prefs.rb +0 -0
  282. data/lib/slack/web/api/endpoints/users_profile.rb +0 -0
  283. data/lib/slack/web/api/endpoints/views.rb +0 -0
  284. data/lib/slack/web/api/endpoints/workflows_featured.rb +0 -0
  285. data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +0 -0
  286. data/lib/slack/web/api/endpoints.rb +24 -0
  287. data/lib/slack/web/api/error.rb +0 -0
  288. data/lib/slack/web/api/errors/server_error.rb +1 -1
  289. data/lib/slack/web/api/errors/slack_error.rb +1 -1
  290. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -1
  291. data/lib/slack/web/api/errors.rb +384 -10
  292. data/lib/slack/web/api/helpers/files.rb +2 -2
  293. data/lib/slack/web/api/helpers.rb +0 -0
  294. data/lib/slack/web/api/mixins/conversations.id.rb +2 -1
  295. data/lib/slack/web/api/mixins/ids.id.rb +2 -1
  296. data/lib/slack/web/api/mixins/users.id.json +0 -0
  297. data/lib/slack/web/api/mixins/users.id.rb +2 -1
  298. data/lib/slack/web/api/mixins/users.search.json +0 -0
  299. data/lib/slack/web/api/mixins/users.search.rb +1 -1
  300. data/lib/slack/web/api/mixins.rb +0 -0
  301. data/lib/slack/web/api/options.rb +0 -0
  302. data/lib/slack/web/api/patches/.gitkeep +0 -0
  303. data/lib/slack/web/api/patches/files.default-filename.patch +12 -0
  304. data/lib/slack/web/api/schema/group.json +0 -0
  305. data/lib/slack/web/api/schema/method.json +0 -0
  306. data/lib/slack/web/api/templates/command.erb +0 -0
  307. data/lib/slack/web/api/templates/endpoints.erb +0 -0
  308. data/lib/slack/web/api/templates/errors.erb +0 -0
  309. data/lib/slack/web/api/templates/method.erb +0 -0
  310. data/lib/slack/web/api/templates/method_spec.erb +0 -0
  311. data/lib/slack/web/client.rb +29 -0
  312. data/lib/slack/web/config.rb +0 -0
  313. data/lib/slack/web/faraday/connection.rb +0 -0
  314. data/lib/slack/web/faraday/options.rb +0 -0
  315. data/lib/slack/web/faraday/request.rb +22 -2
  316. data/lib/slack/web/faraday/response/raise_error.rb +0 -0
  317. data/lib/slack/web/faraday/response/wrap_error.rb +0 -0
  318. data/lib/slack/web/pagination/cursor.rb +0 -0
  319. data/lib/slack-ruby-client.rb +0 -0
  320. data/lib/slack.rb +0 -0
  321. data/lib/slack_ruby_client.rb +0 -0
  322. data/lib/tasks/git.rake +0 -0
  323. data/lib/tasks/update.rake +0 -0
  324. data/lib/tasks/web.rake +0 -0
  325. data/script/release.rb +33 -0
  326. data/slack-ruby-client.gemspec +1 -3
  327. data/slack.png +0 -0
  328. metadata +41 -17
data/bin/commands/chat.rb CHANGED
@@ -10,7 +10,7 @@ module Slack
10
10
  g.long_desc %( Appends text to an existing streaming conversation. )
11
11
  g.command 'appendStream' do |c|
12
12
  c.flag 'channel', desc: 'An encoded ID that represents a channel, private group, or DM.'
13
- c.flag 'chunks', desc: 'Array of streaming chunks.'
13
+ c.flag 'chunks', desc: 'Array of streaming chunks that can contain either markdown text or task updates.'
14
14
  c.flag 'ts', desc: 'The timestamp of the streaming message.'
15
15
  c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. Limit this field to 12,000 characters. This text is what will be appended to the message received so far.'
16
16
  c.action do |_global_options, options, _args|
@@ -82,6 +82,7 @@ module Slack
82
82
  c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.'
83
83
  c.flag 'link_names', desc: 'Find and link channel names and usernames.'
84
84
  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.'
85
+ c.flag 'metadata', desc: 'JSON object with an entities array of work object entity metadata, presented as a URL-encoded string. Only entity metadata is supported: ephemeral messages are not persisted and never dispatch message_metadata_* events, so event_type/event_payload message metadata is ignored here. Each entity requires entity_type, entity_payload, external_ref, and url.'
85
86
  c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
86
87
  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.'
87
88
  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."
@@ -113,6 +114,7 @@ module Slack
113
114
  c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
114
115
  c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
115
116
  c.flag 'username', desc: "Set your bot's user name."
117
+ c.flag 'unfurl_app_links', desc: 'Pass true to unfurl links from installed apps, or false to prevent app links from unfurling. When omitted, app links follow the unfurl_links setting.'
116
118
  c.action do |_global_options, options, _args|
117
119
  puts JSON.dump(@client.chat_postMessage(options))
118
120
  end
@@ -143,13 +145,13 @@ module Slack
143
145
  g.desc 'Starts a new streaming conversation.'
144
146
  g.long_desc %( Starts a new streaming conversation. )
145
147
  g.command 'startStream' do |c|
146
- c.flag 'channel', desc: 'An encoded ID that represents a channel thread or DM.'
147
- c.flag 'chunks', desc: 'Array of streaming chunks.'
148
+ c.flag 'channel', desc: 'An encoded ID that represents a channel, thread, or DM.'
149
+ c.flag 'chunks', desc: 'Array of streaming chunks. Can include markdown text chunk objects, task update chunk objects, plan update chunks, or blocks chunks.'
148
150
  c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. Limit this field to 12,000 characters.'
149
- c.flag 'thread_ts', desc: "Provide another message's ts value to reply to. Streamed messages should always be replies to a user request."
151
+ c.flag 'thread_ts', desc: "Provide another message's ts value to reply to. Omit it to stream a top-level message instead of a thread reply; this is only supported in channels where the whole channel is one session, such as Slack Code, and returns invalid_thread_ts elsewhere. Passing '0' is equivalent to omitting it."
150
152
  c.flag 'recipient_user_id', desc: 'The encoded ID of the user to receive the streaming text. Required when streaming to channels.'
151
153
  c.flag 'recipient_team_id', desc: 'The encoded ID of the team the user receiving the streaming text belongs to. Required when streaming to channels.'
152
- c.flag 'task_display_mode', desc: "Specifies how tasks are displayed in the message. A timeline displays individual tasks with text in sequential order, plan displays all tasks together, with the first tasks's placement determining the placement of the rest of the tasks, and dense collapses consecutive tool calls into a single summarized task card."
154
+ c.flag 'task_display_mode', desc: 'Specifies how tasks are displayed in the message. timeline task updates render as individual task cards interleaved with streamed text. plan task updates render together in a plan block.'
153
155
  c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url.'
154
156
  c.flag 'icon_url', desc: 'Image URL to use as the icon for this message.'
155
157
  c.flag 'username', desc: "The bot's username to display."
@@ -162,11 +164,12 @@ module Slack
162
164
  g.long_desc %( Stops a streaming conversation. )
163
165
  g.command 'stopStream' do |c|
164
166
  c.flag 'channel', desc: 'An encoded ID that represents a channel, private group, or DM.'
165
- c.flag 'chunks', desc: 'Array of streaming chunks.'
167
+ c.flag 'chunks', desc: 'Array of streaming chunks. Can include markdown text chunk objects, task update chunk objects, plan update chunks, or blocks chunks.'
166
168
  c.flag 'ts', desc: 'The timestamp of the streaming message.'
167
169
  c.flag 'markdown_text', desc: 'Accepts message text formatted in markdown. Limit this field to 12,000 characters.'
168
170
  c.flag 'blocks', desc: 'A list of blocks that will be rendered at the bottom of the finalized message.'
169
171
  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.'
172
+ c.flag 'session_status', desc: 'The session status to set after stopping the stream.'
170
173
  c.action do |_global_options, options, _args|
171
174
  puts JSON.dump(@client.chat_stopStream(options))
172
175
  end
@@ -177,7 +180,7 @@ module Slack
177
180
  g.command 'unfurl' do |c|
178
181
  c.flag 'channel', desc: 'Channel ID of the message. Both channel and ts must be provided together, or unfurl_id and source must be provided together. Required for public channels.'
179
182
  c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to. Required for public channels.'
180
- c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments. Required for public channels.'
183
+ c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the message, pointing to their unfurl blocks or message attachments. Required for public channels.'
181
184
  c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons, Not now or Never ask me again.'
182
185
  c.flag 'user_auth_required', desc: 'Set to true or 1 to indicate the user must install your Slack app to trigger unfurls for this domain.'
183
186
  c.flag 'user_auth_url', desc: 'Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.'
File without changes
@@ -100,7 +100,7 @@ module Slack
100
100
  g.command 'invite' do |c|
101
101
  c.flag 'channel', desc: 'The ID of the public or private channel to invite user(s) to.'
102
102
  c.flag 'force', desc: 'When set to true and multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults to false.'
103
- c.flag 'users', desc: 'A comma separated list of user IDs. Up to 100 users may be listed.'
103
+ c.flag 'users', desc: 'A comma separated list of user IDs. Up to 1000 users may be listed.'
104
104
  c.action do |_global_options, options, _args|
105
105
  puts JSON.dump(@client.conversations_invite(options))
106
106
  end
@@ -10,7 +10,7 @@ module Slack
10
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 the canvas will be tabbed in.'
13
- c.flag 'document_content', desc: 'Structure describing the type and value of the content to create.'
13
+ c.flag 'document_content', desc: 'Structure describing the type and value of the content to create. The markdown content is limited to 1 MiB (1,048,576 characters).'
14
14
  c.flag 'title', desc: 'Title of the newly created canvas.'
15
15
  c.action do |_global_options, options, _args|
16
16
  puts JSON.dump(@client.conversations_canvases_create(options))
File without changes
File without changes
data/bin/commands/dnd.rb CHANGED
File without changes
File without changes
@@ -6,6 +6,33 @@ module Slack
6
6
  class App
7
7
  desc 'Entity methods.'
8
8
  command 'entity' do |g|
9
+ g.desc 'Acknowledge a comment mutation (edit, delete, or post) on a work object entity. Apps call this endpoint to confirm they have processed a comment action, and the backend emits a dedicated RTM event to the user.'
10
+ g.long_desc %( Acknowledge a comment mutation (edit, delete, or post) on a work object entity. Apps call this endpoint to confirm they have processed a comment action, and the backend emits a dedicated RTM event to the user. )
11
+ g.command 'acknowledgeCommentAction' do |c|
12
+ c.flag 'trigger_id', desc: 'A reference to the original user action that initiated the comment mutation.'
13
+ c.flag 'comment', desc: 'The full comment data. Required for edit and post actions. See the comment schema for the full list of properties.'
14
+ c.flag 'error', desc: 'Error message if the action failed in the app. When present, signals that the mutation could not be completed.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.entity_acknowledgeCommentAction(options))
17
+ end
18
+ end
19
+
20
+ g.desc 'Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client.'
21
+ g.long_desc %( Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client. )
22
+ g.command 'presentComments' do |c|
23
+ c.flag 'comments', desc: 'Array of comments to present to the user. See the comment schema for the full list of properties.'
24
+ c.flag 'cursor', desc: 'App supplied cursor used for pagination, will be sent in the next request for comments.'
25
+ c.flag 'can_post_comment', desc: 'Indicates whether the user has permissions to post comments.'
26
+ c.flag 'trigger_id', desc: 'A reference to the original user action that initiated the request.'
27
+ c.flag 'delete_action_id', desc: 'The block action id that will be sent when a delete request is initiated for a comment.'
28
+ c.flag 'user_auth_required', desc: 'Set to true (or 1) to indicate that the user must authenticate to see the comments data.'
29
+ c.flag 'user_auth_url', desc: 'A custom URL to which users are directed for authentication if required.'
30
+ c.flag 'error', desc: ''
31
+ c.action do |_global_options, options, _args|
32
+ puts JSON.dump(@client.entity_presentComments(options))
33
+ end
34
+ end
35
+
9
36
  g.desc 'Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client.'
10
37
  g.long_desc %( Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client. )
11
38
  g.command 'presentDetails' do |c|
@@ -15,6 +15,9 @@ module Slack
15
15
  c.flag 'channels', desc: 'Comma-separated string of channel IDs or user IDs where the file will be shared.'
16
16
  c.flag 'initial_comment', desc: 'The message text introducing the file in specified channels.'
17
17
  c.flag 'blocks', desc: 'A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the initial_comment field is provided, the blocks field is ignored.'
18
+ c.flag 'username', desc: "Set your bot's user name for the file share message. Requires the chat:write.customize scope."
19
+ c.flag 'icon_url', desc: 'URL to an image to use as the icon for the file share message. Requires the chat:write.customize scope.'
20
+ c.flag 'icon_emoji', desc: 'Emoji to use as the icon for the file share message. Overrides icon_url. Requires the chat:write.customize scope.'
18
21
  c.action do |_global_options, options, _args|
19
22
  puts JSON.dump(@client.files_completeUploadExternal(options))
20
23
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -22,6 +22,27 @@ module Slack
22
22
  end
23
23
  end
24
24
 
25
+ g.desc 'Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change.'
26
+ g.long_desc %( Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change. )
27
+ g.command 'beginShortTokenRotation' do |c|
28
+ c.flag 'client_id', desc: 'Issued when you created your application. Must be the app the token being rotated was issued to.'
29
+ c.flag 'client_secret', desc: 'Issued when you created your application.'
30
+ c.action do |_global_options, options, _args|
31
+ puts JSON.dump(@client.oauth_v2_beginShortTokenRotation(options))
32
+ end
33
+ end
34
+
35
+ g.desc 'Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process.'
36
+ g.long_desc %( Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process. )
37
+ g.command 'completeShortTokenRotation' do |c|
38
+ c.flag 'client_id', desc: 'Issued when you created your application. Must be the app the token being rotated was issued to.'
39
+ c.flag 'client_secret', desc: 'Issued when you created your application.'
40
+ c.flag 'new_token', desc: 'The new xoxp token returned by oauth.v2.beginShortTokenRotation.'
41
+ c.action do |_global_options, options, _args|
42
+ puts JSON.dump(@client.oauth_v2_completeShortTokenRotation(options))
43
+ end
44
+ end
45
+
25
46
  g.desc 'Exchanges a legacy access token for a new expiring access token and refresh token'
26
47
  g.long_desc %( Exchanges a legacy access token for a new expiring access token and refresh token )
27
48
  g.command 'exchange' do |c|
File without changes
File without changes
data/bin/commands/pins.rb CHANGED
@@ -9,7 +9,7 @@ module Slack
9
9
  g.desc 'Pins an item to a channel.'
10
10
  g.long_desc %( Pins an item to a channel. )
11
11
  g.command 'add' do |c|
12
- c.flag 'channel', desc: 'Channel to pin the messsage to. You must also include a timestamp when pinning messages.'
12
+ c.flag 'channel', desc: 'Channel to pin the message to. You must also include a timestamp when pinning messages.'
13
13
  c.flag 'timestamp', desc: 'Timestamp of the message to pin. You must also include the channel.'
14
14
  c.action do |_global_options, options, _args|
15
15
  puts JSON.dump(@client.pins_add(options))
File without changes
File without changes
data/bin/commands/rtm.rb CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -11,6 +11,10 @@ module Slack
11
11
  g.command 'get' do |c|
12
12
  c.flag 'list_id', desc: 'ID of the List to export.'
13
13
  c.flag 'job_id', desc: 'The ID of the recently started job to export the List.'
14
+ c.flag 'format', desc: 'Format the export was started with. Must match the format passed to slackLists.download.start. Defaults to csv.'
15
+ c.flag 'include_threads', desc: 'Must match the include_threads passed to slackLists.download.start. The returned download_url carries this through so the served export matches what was generated. Only applies when format is json.'
16
+ c.flag 'include_attachments', desc: 'Must match the include_attachments passed to slackLists.download.start. The returned download_url carries this through so the served export matches what was generated. Only applies when format is json.'
17
+ c.flag 'include_archived', desc: 'Must match the include_archived passed to slackLists.download.start. The returned download_url carries this through so the served export includes archived items when they were requested.'
14
18
  c.action do |_global_options, options, _args|
15
19
  puts JSON.dump(@client.slackLists_download_get(options))
16
20
  end
@@ -21,6 +25,9 @@ module Slack
21
25
  g.command 'start' do |c|
22
26
  c.flag 'list_id', desc: 'ID of the List to export.'
23
27
  c.flag 'include_archived', desc: ''
28
+ c.flag 'format', desc: 'Format of the export. Defaults to csv for backward compatibility. Use json for a complete, hierarchical export.'
29
+ c.flag 'include_threads', desc: "Include each item's conversation thread in the export. Only applies when format is json."
30
+ c.flag 'include_attachments', desc: 'Include file attachment metadata and access paths in the export. Only applies when format is json.'
24
31
  c.action do |_global_options, options, _args|
25
32
  puts JSON.dump(@client.slackLists_download_start(options))
26
33
  end
@@ -53,9 +53,10 @@ module Slack
53
53
  g.long_desc %( Get records from a List. )
54
54
  g.command 'list' do |c|
55
55
  c.flag 'list_id', desc: 'ID of the List.'
56
- c.flag 'limit', desc: 'The maximum number of records to return.'
56
+ c.flag 'limit', desc: 'The maximum number of records to return, up to the list row limit of 5000.'
57
57
  c.flag 'cursor', desc: 'Next cursor for pagination.'
58
58
  c.flag 'archived', desc: 'Boolean indicating whether archived items or normal items should be returned.'
59
+ c.flag 'include_list', desc: 'Set to true to also return the parent list object, including its title, column schema, and total row count. Defaults to false to keep the response small.'
59
60
  c.action do |_global_options, options, _args|
60
61
  puts JSON.dump(@client.slackLists_items_list(options))
61
62
  end
@@ -0,0 +1,71 @@
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 'SlackbotSkills methods.'
8
+ command 'slackbot_skills' do |g|
9
+ g.desc 'Creates a skill from markdown instructions, or turns an existing canvas the caller owns into a skill.'
10
+ g.long_desc %( Creates a skill from markdown instructions, or turns an existing canvas the caller owns into a skill. )
11
+ g.command 'create' do |c|
12
+ c.flag 'display_name', desc: 'Human-readable label. Max 255 characters; not unique.'
13
+ c.flag 'instructions', desc: 'Markdown body of the skill. Send exactly one of instructions or canvas_id.'
14
+ c.flag 'canvas_id', desc: 'Canvas the caller owns to turn into a skill. Send exactly one of instructions or canvas_id.'
15
+ c.flag 'description', desc: 'When Slackbot should use the skill. Max 400 characters.'
16
+ c.flag 'category', desc: 'One of the skill categories.'
17
+ c.flag 'example_prompt', desc: 'Max 200 characters. May contain {skill}, which becomes the skill mention.'
18
+ c.flag 'mcp_servers', desc: "Apps the skill needs, capped at the caller's MCP server limit. Declaring an app doesn't grant access to it."
19
+ c.action do |_global_options, options, _args|
20
+ puts JSON.dump(@client.slackbot_skills_create(options))
21
+ end
22
+ end
23
+
24
+ g.desc 'Deletes a Slackbot skill and its canvas, and removes it from every library, skill set, and the org catalog.'
25
+ g.long_desc %( Deletes a Slackbot skill and its canvas, and removes it from every library, skill set, and the org catalog. )
26
+ g.command 'delete' do |c|
27
+ c.flag 'skill_id', desc: 'Skill to delete.'
28
+ c.action do |_global_options, options, _args|
29
+ puts JSON.dump(@client.slackbot_skills_delete(options))
30
+ end
31
+ end
32
+
33
+ g.desc 'Returns one Slackbot skill, including its instructions.'
34
+ g.long_desc %( Returns one Slackbot skill, including its instructions. )
35
+ g.command 'info' do |c|
36
+ c.flag 'skill_id', desc: 'Skill to fetch: a canvas file ID or a builtin: reference.'
37
+ c.action do |_global_options, options, _args|
38
+ puts JSON.dump(@client.slackbot_skills_info(options))
39
+ end
40
+ end
41
+
42
+ g.desc "Lists Slackbot skills from the caller's point of view. Instructions are not included."
43
+ g.long_desc %( Lists Slackbot skills from the caller's point of view. Instructions are not included. )
44
+ g.command 'list' do |c|
45
+ c.flag 'filter', desc: "library: skills enabled for the caller, including auto-enabled skills and skills from skill sets. owned: skills the caller created. catalog: the organization's official skills."
46
+ c.flag 'category', desc: 'Only return skills in this category.'
47
+ 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. Must be used with the same filter and category."
48
+ c.flag 'limit', desc: 'The maximum number of skills to return. Fewer may be returned even when more remain.'
49
+ c.action do |_global_options, options, _args|
50
+ puts JSON.dump(@client.slackbot_skills_list(options))
51
+ end
52
+ end
53
+
54
+ g.desc "Changes a Slackbot skill's instructions or metadata. Only the inputs you send are changed; a call that changes nothing succeeds without writing."
55
+ g.long_desc %( Changes a Slackbot skill's instructions or metadata. Only the inputs you send are changed; a call that changes nothing succeeds without writing. )
56
+ g.command 'update' do |c|
57
+ c.flag 'skill_id', desc: 'Skill to change.'
58
+ c.flag 'display_name', desc: 'Human-readable label. Max 255 characters.'
59
+ c.flag 'instructions', desc: 'Markdown that replaces the whole document.'
60
+ c.flag 'description', desc: 'When Slackbot should use the skill. Max 400 characters. Send an empty string to clear.'
61
+ c.flag 'category', desc: 'One of the skill categories. Send an empty string to clear.'
62
+ c.flag 'example_prompt', desc: 'Max 200 characters. May contain {skill}. Send an empty string to clear.'
63
+ c.flag 'mcp_servers', desc: 'Apps the skill needs. Replaces the whole list; send [] to clear.'
64
+ c.action do |_global_options, options, _args|
65
+ puts JSON.dump(@client.slackbot_skills_update(options))
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,29 @@
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 'SlackbotSkillsLibrary methods.'
8
+ command 'slackbot_skills_library' do |g|
9
+ g.desc "Turns a skill on in the caller's personal library."
10
+ g.long_desc %( Turns a skill on in the caller's personal library. )
11
+ g.command 'add' do |c|
12
+ c.flag 'skill_id', desc: 'Skill to turn on for the caller.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump(@client.slackbot_skills_library_add(options))
15
+ end
16
+ end
17
+
18
+ g.desc "Turns a skill off in the caller's personal library."
19
+ g.long_desc %( Turns a skill off in the caller's personal library. )
20
+ g.command 'remove' do |c|
21
+ c.flag 'skill_id', desc: 'Skill to turn off for the caller.'
22
+ c.action do |_global_options, options, _args|
23
+ puts JSON.dump(@client.slackbot_skills_library_remove(options))
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
File without changes
data/bin/commands/team.rb CHANGED
@@ -35,6 +35,7 @@ module Slack
35
35
  g.command 'info' do |c|
36
36
  c.flag 'domain', desc: "Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself. This is the value set up for the 'Joining This Workspace' workspace setting. If it contains more than one domain, the field will contain multiple comma-separated domain values. If no domain is set, the field is empty."
37
37
  c.flag 'team', desc: 'Team to get info about; if omitted, will return information about the current team.'
38
+ c.flag 'include_slackbot_availability', desc: "Include advisory Slackbot availability for the returned workspace or organization. Only applies to a single team in the caller's own workspace or organization; omitted for external teams. Does not guarantee individual eligibility, remaining usage, or access to a particular app."
38
39
  c.action do |_global_options, options, _args|
39
40
  puts JSON.dump(@client.team_info(options))
40
41
  end
File without changes
@@ -22,7 +22,7 @@ module Slack
22
22
  c.flag 'cursor', desc: "Paginate through collections of data by setting parameter to the team_id attribute returned by a previous request's response_metadata. If not provided, the first page of the collection is returned. See pagination for more detail."
23
23
  c.flag 'sort_field', desc: 'Name of the parameter that we are sorting by.'
24
24
  c.flag 'sort_direction', desc: 'Direction to sort in asc or desc.'
25
- c.flag 'slack_connect_pref_filter', desc: 'Filters connected orgs by Slack Connect pref override(s). Value can be: approved_orgs_only allow_sc_file_uploads profile_visibility away_team_sc_invite_permissions accept_sc_invites sc_mpdm_to_private require_sc_channel_for_sc_dm external_awareness_context_bar.'
25
+ c.flag 'slack_connect_pref_filter', desc: 'Filters connected orgs by Slack Connect pref override(s). Value can be: approved_orgs_only allow_sc_file_uploads profile_visibility away_team_sc_invite_permissions accept_sc_invites sc_mpdm_to_private external_awareness_context_bar.'
26
26
  c.flag 'workspace_filter', desc: 'Shows connected orgs which are connected on a specified encoded workspace ID.'
27
27
  c.flag 'connection_status_filter', desc: 'Status of the connected team.'
28
28
  c.action do |_global_options, options, _args|
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -11,6 +11,7 @@ module Slack
11
11
  g.command 'conversations' do |c|
12
12
  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. Default value fetches the first 'page' of the collection. See pagination for more detail."
13
13
  c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
14
+ c.flag 'exclude_muted', desc: 'Set to true to exclude muted channels from the list.'
14
15
  c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer with a max value of 999."
15
16
  c.flag 'team_id', desc: 'encoded team id to list conversations in, required if org token is used.'
16
17
  c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/bin/slack CHANGED
@@ -1,5 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
- require 'gli'
2
+ begin
3
+ require 'gli'
4
+ rescue LoadError
5
+ abort "The slack command-line client requires the gli gem. Add `gem 'gli'` to your Gemfile, or run `gem install gli`."
6
+ end
3
7
  require 'slack_ruby_client'
4
8
 
5
9
  module Slack
File without changes
File without changes
@@ -1,13 +1,14 @@
1
+ # Files Upload V2 Example
2
+
1
3
  Samples for using `files_upload_v2`.
2
4
 
3
5
  ## Usage
4
6
 
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
+ Create a Slack app and [obtain a User OAuth Token](https://docs.slack.dev/authentication/tokens/) or use the [oauth_v2](../oauth_v2) example to obtain a User OAuth Token. Make sure to select `files:write` and `files:read` scopes under "User Token Scopes".
7
8
 
8
9
  Create `.env` file with `SLACK_API_TOKEN` or set the `SLACK_API_TOKEN` environment variable.
9
10
 
10
- ```
11
+ ```bash
11
12
  bundle install
12
13
  bundle exec dotenv ruby files_upload_v2.rb
13
14
  ```
@@ -3,7 +3,7 @@ require 'slack-ruby-client'
3
3
  require 'securerandom'
4
4
 
5
5
  Slack.configure do |config|
6
- config.token = ENV['SLACK_API_TOKEN']
6
+ config.token = ENV.fetch('SLACK_API_TOKEN', nil)
7
7
  raise 'Missing ENV[SLACK_API_TOKEN]!' unless config.token
8
8
  end
9
9
 
File without changes
File without changes
@@ -2,7 +2,7 @@
2
2
  require 'slack-ruby-client'
3
3
 
4
4
  Slack.configure do |config|
5
- config.token = ENV['SLACK_API_TOKEN']
5
+ config.token = ENV.fetch('SLACK_API_TOKEN', nil)
6
6
  raise 'Missing ENV[SLACK_API_TOKEN]!' unless config.token
7
7
  end
8
8
 
File without changes
@@ -2,7 +2,7 @@
2
2
  require 'slack-ruby-client'
3
3
 
4
4
  Slack.configure do |config|
5
- config.token = ENV['SLACK_API_TOKEN']
5
+ config.token = ENV.fetch('SLACK_API_TOKEN', nil)
6
6
  raise 'Missing ENV[SLACK_API_TOKEN]!' unless config.token
7
7
  end
8
8
 
File without changes
File without changes
@@ -1,9 +1,10 @@
1
+ # OAuth V2 Example
2
+
1
3
  Obtain a user OAuth token from Slack.
2
4
 
3
- Create a Slack app [here](https://api.slack.com/tutorials/tracks/getting-a-token).
5
+ [Create a Slack app](https://api.slack.com/apps).
4
6
 
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
+ The new app has a pre-configured User OAuth Token which you can use for most of the examples. However you may want to obtain a token for a different user, which can be accomplished as follows.
7
8
 
8
9
  To test locally use [ngrok](https://ngrok.com/) to expose your local server to the internet.
9
10
 
@@ -15,7 +16,7 @@ Add the ngrok URL to the app's "Redirect URLs" under "OAuth & Permissions" in th
15
16
 
16
17
  Create a `.env` file with the following:
17
18
 
18
- ```
19
+ ```dotenv
19
20
  SLACK_CLIENT_ID=[App Client ID]
20
21
  SLACK_CLIENT_SECRET=[App Client Secret]
21
22
  REDIRECT_URI=[Your ngrok URL, e.g. https://...ngrok-free.app]
@@ -18,8 +18,8 @@ server.mount_proc '/' do |req, res|
18
18
 
19
19
  response = client.oauth_v2_access(
20
20
  req.query.merge(
21
- client_id: ENV['SLACK_CLIENT_ID'],
22
- client_secret: ENV['SLACK_CLIENT_SECRET'],
21
+ client_id: ENV.fetch('SLACK_CLIENT_ID', nil),
22
+ client_secret: ENV.fetch('SLACK_CLIENT_SECRET', nil),
23
23
  grant_type: 'authorization_code'
24
24
  )
25
25
  )
@@ -47,10 +47,10 @@ server.mount_proc '/' do |req, res|
47
47
  end
48
48
 
49
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']
50
+ client_id: ENV.fetch('SLACK_CLIENT_ID', nil),
51
+ redirect_uri: ENV.fetch('REDIRECT_URI', nil),
52
+ scope: ENV.fetch('SCOPE', nil),
53
+ user_scope: ENV.fetch('USER_SCOPE', nil)
54
54
  }
55
55
 
56
56
  url = "https://slack.com/oauth/v2/authorize?#{query.to_query}"
data/lib/slack/config.rb CHANGED
File without changes
@@ -12,7 +12,7 @@ module Slack
12
12
  attr_accessor(*Config::ATTRIBUTES)
13
13
 
14
14
  def reset
15
- self.signing_secret = ENV['SLACK_SIGNING_SECRET']
15
+ self.signing_secret = ENV.fetch('SLACK_SIGNING_SECRET', nil)
16
16
  self.signature_expires_in = 5 * 60
17
17
  end
18
18
  end
@@ -40,9 +40,9 @@ module Slack
40
40
  def body
41
41
  @body ||= begin
42
42
  input = http_request.body
43
- input.rewind
43
+ input.rewind if input.respond_to?(:rewind)
44
44
  body = input.read
45
- input.rewind
45
+ input.rewind if input.respond_to?(:rewind)
46
46
  body
47
47
  end
48
48
  end
data/lib/slack/logger.rb CHANGED
File without changes