Closed MarioRuiz closed 1 year ago
If I use send file endpoint then it is sent as a file so it is not displayed
What do you mean not displayed? What is your code? The example in the README here works.
client.files_upload(
channels: "#slack-ruby",
file: Faraday::UploadIO.new("grogu.jpg", "image/jpeg"),
title: "Grogu",
filename: "grogu.jpg",
initial_comment: "I like frogs."
)
sending this code:
client.files_upload(
channels: "#test-sm",
file: Faraday::UploadIO.new("./tmp/rmario.jpg", "image/jpeg"),
title: "Grogu",
filename: "rmario.jpg",
initial_comment: "I like frogs."
)
I get:
rmario.jpg is only 197Kb
Ok I think I know why.... It seems like the file I am uploading has .jpg extension but in fact it is a png so Slack is not displaying it
Is there any way to send a chat post attached with an image, fex:
If I use send file endpoint then it is sent as a file so it is not displayed
If I use the attachments parameter and include the image URL, it is displayed but then if the URL image is not available anymore then it is not displayed.
I need this to be able to send images created using the OpenAI generated images and they are just live for one hour