I set up a Slackbot to post Craigslist listings and the URL is no longer unfurling to display the preview image when the message is posted.
A few things to note:
I have selected the following scopes under OAuth & Permissions, as stated in https://api.slack.com/reference/messaging/link-unfurling#setup
- links:read
- links:write
'https://' is included in my image URLs
each link is a valid URL that links to an image
Any random Craigslist link I include doesn't unfurl in Slack (it used to)
I've ran this Slackbot before (not the final code) where the preview image was showing. I understand that Slack doesn't render images if the unique link has already been shared in the channel, but right now this isn't the case. I also noticed that when the preview images were rendering before, the message was "edited". See screenshot
What the message in Slack looks like now, on 9/15
My post_to_slack function:
client = WebClient(SLACK_TOKEN)
attachments = [{"image_url": image_url_link}]
desc = f" {result_price.text} | {title_text} | {datetime} | {url} | {neighborhood_text} | {final_final_strip} | {image_url_link} | "
response = client.chat_postMessage(channel=SLACK_CHANNEL, text=desc, attachments=attachments, unfurl_links=True, unfurl_media=True)
Am I missing something? Did Slack update something with unfurling or is it Craigslist? Any insight would be appreciated. Thank you!
The images were able to show up after including the .jpg URL in the Slack message. I forgot I had this previously