HubSpot / slack-client

An asynchronous HTTP client for Slack's web API
Apache License 2.0
114 stars 53 forks source link

Support Attachment upon link unfurling #287

Closed zmarushchak-hs closed 2 years ago

zmarushchak-hs commented 2 years ago

The model for unfurling messages was recently updated to match the latest changes in Slack (using Block Kit blocks in unfurling messages). But, Slack still supports old-fashioned unfurling messages which use Attachments, instead of Blocks. We had a talk with Slack guys and they assured us that they are not going to deprecate this. Some projects still use the old way for message unfurling and don't have plans to migrate to Block Kit in the near future. As a temporary workaround, I've added a common interface to support both cases. The solution is not ideal, since BlockOrAttachment and ChatUnfurlBlocksIF represent different object families, but this is the easiest way to do this.