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)

* [#375](https://github.com/slack-ruby/slack-ruby-client/pull/375): Set a default filename in `files_upload` so Slack displays image previews correctly when none is specified - [@ts-3156](https://github.com/ts-3156), [@dblock](https://github.com/dblock).
* [#591](https://github.com/slack-ruby/slack-ruby-client/pull/591): Generate AI CHANGELOG entries and PR summaries for automated API update PRs, lock simplecov below 1.1.0 to avoid breaking Coveralls - [@dblock](https://github.com/dblock).
* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add entity.acknowledgeCommentAction and entity.presentComments methods - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add admin.apps.mcpServers, admin.apps.mcpServers.permissions, and admin.apps.permissions endpoints - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
Expand Down
1 change: 1 addition & 0 deletions lib/slack/web/api/endpoints/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def files_sharedPublicURL(options = {})
# @see https://api.slack.com/methods/files.upload
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files/files.upload.json
def files_upload(options = {})
options = options.merge(filename: 'file') if options[:file] && !options[:filename]
post('files.upload', options)
end
end
Expand Down
12 changes: 12 additions & 0 deletions lib/slack/web/api/patches/files.default-filename.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/lib/slack/web/api/endpoints/files.rb b/lib/slack/web/api/endpoints/files.rb
index 13a1889..9ce4894 100644
--- a/lib/slack/web/api/endpoints/files.rb
+++ b/lib/slack/web/api/endpoints/files.rb
@@ -192,6 +192,7 @@ module Slack
# @see https://api.slack.com/methods/files.upload
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files/files.upload.json
def files_upload(options = {})
+ options = options.merge(filename: 'file') if options[:file] && !options[:filename]
post('files.upload', options)
end
end
Loading