gpt4 book ai didi

node.js - 如何在 Slack 附件的字段选项内添加 URL?

转载 作者:搜寻专家 更新时间:2023-11-01 00:14:33 27 4
gpt4 key购买 nike

我正在尝试从外部来源向 Slack channel 发送通知。我试图将 URL 链接放在附件的字段标记中。有办法吗?

{
"attachments": [
{
"fallback": "Required plain-text summary of the attachment.",

"color": "#36a64f",

"pretext": "Optional text that appears above the attachment block",

"author_name": "Bobby Tables",
"author_link": "http://flickr.com/bobby/",
"author_icon": "http://flickr.com/icons/bobby.jpg",

"title": "Slack API Documentation",
"title_link": "https://api.slack.com/",

"text": "Optional text that appears within the attachment",

"fields": [
{
"title": "Priority",
"value": "High",
"short": false
}
],

"image_url": "http://my-website.com/path/to/image.jpg",
"thumb_url": "http://example.com/path/to/thumb.png"
}
]
}

最佳答案

是的,您可以在字段中使用 URL。但它只适用于 value 标签。您甚至可以在那里使用标记。

这是一个 PHP 示例:

$slack->addAttachment( array (
"fallback" => "Fallback",
"title" => "Title",
"text" => "text",
"fields" => array (
array (
"title" => "Priority",
"value" => "<http://i.imgur.com/nwo13SM.png|test>",
"short" => false
)
)
));

关于node.js - 如何在 Slack 附件的字段选项内添加 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35030496/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com