我正在使用自适应卡在节点 js 中向用户展示一篇文章。
我的自适应卡片格式:
function AdaptCard(Txt, Img, Url) {
let cardFormat = {
contentType: "application/vnd.microsoft.card.adaptive",
content: {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": Txt,
"size": "medium",
"weight": "bolder",
"wrap": true
},
{
"type": "Image",
"url": Img,
"size": "auto"
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "View Article",
"url": Url
}
]
}
};
return cardFormat;
}
会话代码:
bot.beginDialog(message.address, 'ShowArticle');
bot.dialog('ShowArticle', [
(session) => {
let dispCard = new builder.Message(session).addAttachment(AdaptCard("Title", "Image URL", "Link URL" ));
session.send(dispCard );
}]);
在他访问文章后,我试图询问用户提供的 url 是否有用?一旦用户执行Action.OpenUrl,我可以使用任何像bot.on('some event') 的事件吗?
需要帮助。