teams.message() 函数
teams.message()
是由包作者维护的用户贡献函数。
teams.message()
使用传入 webhook向 Microsoft Teams 频道发送单条消息。
函数类型签名
(text: string, title: A, url: string, ?summary: string) => int
有关更多信息,请参阅函数类型签名。
参数
url
(必需) 传入 webhook URL。
title
(必需) 消息卡片标题。
text
(必需) 消息卡片文本。
summary
消息卡片摘要。默认为 ""
。
如果未提供摘要,Flux 将从消息文本生成摘要。
示例
向 Microsoft Teams 频道发送上次报告的状态
import "contrib/sranka/teams"
lastReported =
from(bucket: "example-bucket")
|> range(start: -1m)
|> filter(fn: (r) => r._measurement == "statuses")
|> last()
|> findRecord(fn: (key) => true, idx: 0)
teams.message(
url: "https://outlook.office.com/webhook/example-webhook",
title: "Disk Usage",
text: "Disk usage is: *${lastReported.status}*.",
summary: "Disk usage is ${lastReported.status}",
)
此页面是否对您有帮助?
感谢您的反馈!