我正在创建Microsoft流程,以在团队中Flow机器人发布的Adaptive卡中提及用户。
这是我的JSON的简化版本,
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"color": "Attention",
"text": "Hey!"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"text": "<at>steve@example.com</at>",
}
],
"width": "stretch"
}
]
}
]
},
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Teams Message",
"url": "-teamsUrl-"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
不幸的是,这只是显示为<at>steve@example.com</at>
如果我使用与发送给车队频道的消息相同的语法,则会提及该用户。
是否可以通过这种方式在自适应卡中提及用户?
答案 0 :(得分:1)
提及内容仅适用于Adaptive Card,但仅适用于1.2版。
官方文档:Mention support within Adaptive cards v1.2
{
"version":"1.2",
"type":"AdaptiveCard",
"body":[
{
"type":"TextBlock",
"text":"Ahoj <at>Michal Macejko</at>",
"wrap":True
}
],
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"msteams":{
"entities":[
{
"additional_properties": {},
"text": "<at>Michal Macejko</at>",
"type": "mention",
"mentioned":
{
"additional_properties": {},
"id": "channelAccountID",
"name": "Michal Macejko",
"aad_object_id": "userID"
}
}
]
}
}
aad_object_id
是userId
的{{1}}属性,
https://graph.microsoft.com/v1.0/teams/#{team_id}/members
是您应该从SDK get_conversation_member
这是一个python示例:
channelAccountID