slack-api – 替换自定义集成中的URL

我已将Twitter和Google Drive应用添加到我的Slack团队.对于我目前正在开发的ERP系统,我想更换某些与Twitter / Google Drive相似的URL:

> Google云端硬盘:

Your message containing the link will be changed into a share message
point to the external reference file in Slack

《slack-api – 替换自定义集成中的URL》
> Twitter:

Automatically expand pasted Twitter URLs, displaying the full tweet
and attached media

显而易见的方法似乎是使用带有URL的第一部分(例如https://erp.acme.com)的Outgoing Webhook作为“触发词”,但这似乎不适用于私人组和频道. Google云端硬盘似乎没有此限制.哪种API提供足够的灵活性?

最佳答案 Slack的一位工程师回复并提供了两种解决方案.谢谢布拉德!

解决方案A.

将传出的webhook触发器设置为< https://erp.acme.com – 注意开头<,因为这是在Slack方面解析URL的方式.传出的webhook目前只能在公共频道中使用. 解决方案B. 提供meta标签以利用Slack的“展开”. 你可以阅读link expanding documentation here,以及关于Slack展开的in-depth blog post.

《slack-api – 替换自定义集成中的URL》

点赞