我找不到任何可用文档,可以在团队 channel 中发送的每条消息中提及用户。我必须使用传入的网络钩子(Hook)将消息发送到 channel 。 消息将从 azure 函数发送。这是我到目前为止尝试过的代码。
axios
.post(
'https://name.webhook.office.com/webhookb2/xxx@xyz/IncomingWebhook/xxx/xxxb',
{
'@type': 'MessageCard',
'@context': 'http://schema.org/extensions',
themeColor: '0072C6', // light blue
summary: 'Summary description',
sections: [
{
activityTitle: title,
text: message
}
]
}
)
.then(
(resolvedValue) => {
resolve(`Sent message to teams ${resolvedValue}`);
},
(error) => {
reject(error);
}
);
我想提及某个用户,以便他们在消息到达时收到提醒。
最佳答案
请通过User mention in Incoming Webhook with Adaptive Cards其中讨论了在自适应卡正文中添加 @mentions 以用于传入的 webhook。
请查看Format cards with Markdown在卡片中添加格式。
关于azure - 如何在团队 channel 传入 Webhook 中提及用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73726203/