From e34fd791fa72559c4036718dc2d0f849d352a718 Mon Sep 17 00:00:00 2001 From: ts-3156 Date: Fri, 7 May 2021 20:54:41 +0900 Subject: [PATCH] Set a default filename so that Slack displays the preview correctly --- lib/slack/web/api/endpoints/files.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/slack/web/api/endpoints/files.rb b/lib/slack/web/api/endpoints/files.rb index 1f9b3680..ac810f2a 100644 --- a/lib/slack/web/api/endpoints/files.rb +++ b/lib/slack/web/api/endpoints/files.rb @@ -144,6 +144,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