Slack - 如何发布指向网络文件夹的链接?

时间:2016-03-21 18:27:16

标签: slack-api slack

我正在使用webhook通过PowerShell脚本向Slack发布消息,我想要包含一个指向网络文件夹的链接。我能够用

做到这一点
    <file://server/folder|files>

然而,当点击生成的“文件”链接时,没有任何反应。有没有办法指定目标,以便在新窗口中打开单击的链接?如果我复制生成的链接并将其粘贴到浏览器中,索引就会很好地呈现,这对我的目的来说已经足够了。有没有其他解决方案?

1 个答案:

答案 0 :(得分:0)

Slack's Link Buttons可能会取得一些成功,点击时会在新浏览器标签中专门打开链接。

{
    "text": "Test Link Buttons",
    "channel": "C061EG9SL",
    "attachments": [
        {
            "fallback": "Test link button to file://server/folder",
            "actions": [
                {
                    "type": "button",
                    "name": "file_request_123456",
                    "text": "Test",
                    "url": "file://server/folder",
                    "style": "primary",
                    "confirm": "Really?"
                }
            ]
        }
    ]
}

Slack Message Builder example