在Adaptive Card中使用Teams标记可以通过以下三步来实现:
{ "type": "TextBlock", "text": "Hello [@Team1], please complete the task by tomorrow." }
const text = Hello
;
await turnContext.sendActivity({
type: ActivityTypes.Message,
text: text,
entities: [
{
type: "mention",
mentioned: {
id: teamId,
name: "Team1"
},
text: "@Team1"
}
]
});
示例代码:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Hello [@Team1], please complete the task by tomorrow."
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
const text = `Hello ${teamId} , please complete the task by tomorrow.`;
await turnContext.sendActivity({
type: ActivityTypes.Message,
text: text,
entities: [
{
type: "mention",
mentioned: {
id: teamId,
name: "Team1"
},
text: "@Team1"
}
]
});
下一篇:Adaptivecolumns