chore: Slack file upload changes (#10903)
The Slack `files.upload` API endpoint is deprecated and will stop functioning on March 11, 2025. In this PR, we have implemented the changes for the [new file upload](https://api.slack.com/messaging/files#uploading_files) method.
This commit is contained in:
@@ -119,12 +119,14 @@ class Integrations::Slack::SendOnSlackService < Base::SendOnChannelService
|
||||
def upload_file
|
||||
return unless message.attachments.first.with_attached_file?
|
||||
|
||||
result = slack_client.files_upload({
|
||||
channels: hook.reference_id,
|
||||
result = slack_client.files_upload_v2(
|
||||
filename: message.attachments.first.file.filename,
|
||||
content: message.attachments.first.file.download,
|
||||
initial_comment: 'Attached File!',
|
||||
thread_ts: conversation.identifier
|
||||
}.merge(file_information))
|
||||
Rails.logger.info(result)
|
||||
thread_ts: conversation.identifier,
|
||||
channel_id: hook.reference_id
|
||||
)
|
||||
Rails.logger.info "slack_upload_result: #{result}"
|
||||
end
|
||||
|
||||
def file_type
|
||||
|
||||
Reference in New Issue
Block a user