Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 3.2.1 (Next)

* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Update API from [slack-api-ref@784d1d4](https://github.com/slack-ruby/slack-api-ref/commit/784d1d4) - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* Your contribution here.

### 3.2.0 (2026/07/05)
Expand Down
1 change: 1 addition & 0 deletions bin/commands/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class App
c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.'
c.flag 'link_names', desc: 'Find and link channel names and usernames.'
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.'
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.'
c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
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.'
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."
Expand Down
27 changes: 27 additions & 0 deletions bin/commands/entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ module Cli
class App
desc 'Entity methods.'
command 'entity' do |g|
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.'
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. )
g.command 'acknowledgeCommentAction' do |c|
c.flag 'trigger_id', desc: 'A reference to the original user action that initiated the comment mutation.'
c.flag 'comment', desc: 'The full comment data. Required for edit and post actions. See the comment schema for the full list of properties.'
c.flag 'error', desc: 'Error message if the action failed in the app. When present, signals that the mutation could not be completed.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.entity_acknowledgeCommentAction(options))
end
end

g.desc 'Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client.'
g.long_desc %( Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client. )
g.command 'presentComments' do |c|
c.flag 'comments', desc: 'Array of comments to present to the user. See the comment schema for the full list of properties.'
c.flag 'cursor', desc: 'App supplied cursor used for pagination, will be sent in the next request for comments.'
c.flag 'can_post_comment', desc: 'Indicates whether the user has permissions to post comments.'
c.flag 'trigger_id', desc: 'A reference to the original user action that initiated the request.'
c.flag 'delete_action_id', desc: 'The block action id that will be sent when a delete request is initiated for a comment.'
c.flag 'user_auth_required', desc: 'Set to true (or 1) to indicate that the user must authenticate to see the comments data.'
c.flag 'user_auth_url', desc: 'A custom URL to which users are directed for authentication if required.'
c.flag 'error', desc: ''
c.action do |_global_options, options, _args|
puts JSON.dump(@client.entity_presentComments(options))
end
end

g.desc 'Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client.'
g.long_desc %( Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client. )
g.command 'presentDetails' do |c|
Expand Down
3 changes: 3 additions & 0 deletions bin/commands/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class App
c.flag 'channels', desc: 'Comma-separated string of channel IDs or user IDs where the file will be shared.'
c.flag 'initial_comment', desc: 'The message text introducing the file in specified channels.'
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.'
c.flag 'username', desc: "Set your bot's user name for the file share message. Requires the chat:write.customize scope."
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.'
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.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.files_completeUploadExternal(options))
end
Expand Down
6 changes: 6 additions & 0 deletions bin/commands/slackLists_download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class App
g.command 'get' do |c|
c.flag 'list_id', desc: 'ID of the List to export.'
c.flag 'job_id', desc: 'The ID of the recently started job to export the List.'
c.flag 'format', desc: 'Format the export was started with. Must match the format passed to slackLists.download.start. Defaults to csv.'
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.'
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.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.slackLists_download_get(options))
end
Expand All @@ -21,6 +24,9 @@ class App
g.command 'start' do |c|
c.flag 'list_id', desc: 'ID of the List to export.'
c.flag 'include_archived', desc: ''
c.flag 'format', desc: 'Format of the export. Defaults to csv for backward compatibility. Use json for a complete, hierarchical export.'
c.flag 'include_threads', desc: "Include each item's conversation thread in the export. Only applies when format is json."
c.flag 'include_attachments', desc: 'Include file attachment metadata and access paths in the export. Only applies when format is json.'
c.action do |_global_options, options, _args|
puts JSON.dump(@client.slackLists_download_start(options))
end
Expand Down
1 change: 0 additions & 1 deletion lib/slack/web/api/endpoints/admin_emoji.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module AdminEmoji
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.emoji/admin.emoji.add.json
def admin_emoji_add(options = {})
raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?
raise ArgumentError, 'Required arguments :url missing' if options[:url].nil?
post('admin.emoji.add', options)
end

Expand Down
12 changes: 7 additions & 5 deletions lib/slack/web/api/endpoints/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def chat_meMessage(options = {})
# Find and link channel names and usernames.
# @option options [string] :markdown_text
# 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.
# @option options [string] :metadata
# 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.
# @option options [string] :parse
# Change how messages are treated. Defaults to none. See below.
# @option options [string] :text
Expand All @@ -147,9 +149,9 @@ def chat_postEphemeral(options = {})
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
raise ArgumentError, 'Required arguments :user missing' if options[:user].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text, :markdown_text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:markdown_text].nil?
raise ArgumentError, ':text, :markdown_text are mutually exclusive' if !options[:text].nil? && !options[:markdown_text].nil?
raise ArgumentError, 'Exactly one of :text, :markdown_text is required' unless options[:text].nil? ^ options[:markdown_text].nil?
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
options = encode_options_as_json(options, %i[attachments blocks])
options = encode_options_as_json(options, %i[attachments blocks metadata])
post('chat.postEphemeral', options)
end

Expand Down Expand Up @@ -197,7 +199,7 @@ def chat_postEphemeral(options = {})
def chat_postMessage(options = {})
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text, :markdown_text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:markdown_text].nil?
raise ArgumentError, ':text, :markdown_text are mutually exclusive' if !options[:text].nil? && !options[:markdown_text].nil?
raise ArgumentError, 'Exactly one of :text, :markdown_text is required' unless options[:text].nil? ^ options[:markdown_text].nil?
options = encode_options_as_json(options, %i[attachments blocks metadata])
post('chat.postMessage', options)
end
Expand Down Expand Up @@ -239,7 +241,7 @@ def chat_scheduleMessage(options = {})
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
raise ArgumentError, 'Required arguments :post_at missing' if options[:post_at].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text, :markdown_text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:markdown_text].nil?
raise ArgumentError, ':text, :markdown_text are mutually exclusive' if !options[:text].nil? && !options[:markdown_text].nil?
raise ArgumentError, 'Exactly one of :text, :markdown_text is required' unless options[:text].nil? ^ options[:markdown_text].nil?
options = encode_options_as_json(options, %i[attachments blocks metadata])
post('chat.scheduleMessage', options)
end
Expand Down Expand Up @@ -365,7 +367,7 @@ def chat_update(options = {})
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
raise ArgumentError, 'Required arguments :ts missing' if options[:ts].nil?
raise ArgumentError, 'At least one of :attachments, :blocks, :text, :markdown_text is required' if options[:attachments].nil? && options[:blocks].nil? && options[:text].nil? && options[:markdown_text].nil?
raise ArgumentError, ':text, :markdown_text are mutually exclusive' if !options[:text].nil? && !options[:markdown_text].nil?
raise ArgumentError, 'Exactly one of :text, :markdown_text is required' unless options[:text].nil? ^ options[:markdown_text].nil?
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
options = encode_options_as_json(options, %i[attachments unfurled_attachments blocks metadata])
post('chat.update', options)
Expand Down
48 changes: 48 additions & 0 deletions lib/slack/web/api/endpoints/entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,54 @@ module Web
module Api
module Endpoints
module Entity
#
# 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.
#
# @option options [string] :trigger_id
# A reference to the original user action that initiated the comment mutation.
# @option options [object] :comment
# The full comment data. Required for edit and post actions. See the comment schema for the full list of properties.
# @option options [string] :error
# Error message if the action failed in the app. When present, signals that the mutation could not be completed.
# @see https://api.slack.com/methods/entity.acknowledgeCommentAction
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/entity/entity.acknowledgeCommentAction.json
def entity_acknowledgeCommentAction(options = {})
raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
post('entity.acknowledgeCommentAction', options)
end

#
# Provide comments for work objects. Apps call this endpoint to send per-user flexpane comment data to the client.
#
# @option options [array] :comments
# Array of comments to present to the user. See the comment schema for the full list of properties.
# @option options [string] :cursor
# App supplied cursor used for pagination, will be sent in the next request for comments.
# @option options [boolean] :can_post_comment
# Indicates whether the user has permissions to post comments.
# @option options [string] :trigger_id
# A reference to the original user action that initiated the request.
# @option options [string] :delete_action_id
# The block action id that will be sent when a delete request is initiated for a comment.
# @option options [boolean] :user_auth_required
# Set to true (or 1) to indicate that the user must authenticate to see the comments data.
# @option options [string] :user_auth_url
# A custom URL to which users are directed for authentication if required.
# @option options [Object] :error
# @see https://api.slack.com/methods/entity.presentComments
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/entity/entity.presentComments.json
def entity_presentComments(options = {})
raise ArgumentError, 'Required arguments :comments missing' if options[:comments].nil?
raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
if block_given?
Pagination::Cursor.new(self, :entity_presentComments, options).each do |page|
yield page
end
else
post('entity.presentComments', options)
end
end

#
# Provide custom flexpane behavior for Work Objects. Apps call this endpoint to send per-user flexpane metadata to the client.
#
Expand Down
6 changes: 6 additions & 0 deletions lib/slack/web/api/endpoints/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ module Files
# The message text introducing the file in specified channels.
# @option options [string] :blocks
# 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.
# @option options [string] :username
# Set your bot's user name for the file share message. Requires the chat:write.customize scope.
# @option options [string] :icon_url
# URL to an image to use as the icon for the file share message. Requires the chat:write.customize scope.
# @option options [string] :icon_emoji
# Emoji to use as the icon for the file share message. Overrides icon_url. Requires the chat:write.customize scope.
# @see https://api.slack.com/methods/files.completeUploadExternal
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files/files.completeUploadExternal.json
def files_completeUploadExternal(options = {})
Expand Down
12 changes: 12 additions & 0 deletions lib/slack/web/api/endpoints/slackLists_download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ module SlackListsDownload
# ID of the List to export.
# @option options [string] :job_id
# The ID of the recently started job to export the List.
# @option options [Object] :format
# Format the export was started with. Must match the format passed to slackLists.download.start. Defaults to csv.
# @option options [boolean] :include_threads
# 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.
# @option options [boolean] :include_attachments
# 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.
# @see https://api.slack.com/methods/slackLists.download.get
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/slackLists.download/slackLists.download.get.json
def slackLists_download_get(options = {})
Expand All @@ -27,6 +33,12 @@ def slackLists_download_get(options = {})
# @option options [string] :list_id
# ID of the List to export.
# @option options [boolean] :include_archived
# @option options [Object] :format
# Format of the export. Defaults to csv for backward compatibility. Use json for a complete, hierarchical export.
# @option options [boolean] :include_threads
# Include each item's conversation thread in the export. Only applies when format is json.
# @option options [boolean] :include_attachments
# Include file attachment metadata and access paths in the export. Only applies when format is json.
# @see https://api.slack.com/methods/slackLists.download.start
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/slackLists.download/slackLists.download.start.json
def slackLists_download_start(options = {})
Expand Down
Loading