如何从node.js中的自适应卡读取按钮动作?
如果我有如下自适应卡:如何从node.js中的自适应卡读取按钮动作?,node.js,botframework,adaptive-cards,Node.js,Botframework,Adaptive Cards,如果我有如下自适应卡: var msg = new builder.Message(session) .addAttachment({ contentType: "application/vnd.microsoft.card.adaptive", content: { type: "AdaptiveCard", speak: "<s>Your meeting about \"Adaptive Card design session\"
var msg = new builder.Message(session)
.addAttachment({
contentType: "application/vnd.microsoft.card.adaptive",
content: {
type: "AdaptiveCard",
speak: "<s>Your meeting about \"Adaptive Card design session\"<break strength='weak'/> is starting at 12:30pm</s><s>Do you want to snooze <break strength='weak'/> or do you want to send a late notification to the attendees?</s>",
body: [
{
"type": "TextBlock",
"text": "Adaptive Card design session",
"size": "large",
"weight": "bolder"
},
{
"type": "TextBlock",
"text": "Conf Room 112/3377 (10)"
},
{
"type": "TextBlock",
"text": "12:30 PM - 1:30 PM"
},
{
"type": "TextBlock",
"text": "Snooze for"
},
{
"type": "Input.ChoiceSet",
"id": "snooze",
"style":"compact",
"choices": [
{
"title": "5 minutes",
"value": "5",
"isSelected": true
},
{
"title": "15 minutes",
"value": "15"
},
{
"title": "30 minutes",
"value": "30"
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Snooze"
},
{
"type": "Action.Submit",
"title": "I'll be late"
}
]
}
});
var msg=new builder.Message(会话)
.附件({
contentType:“application/vnd.microsoft.card.adaptive”,
内容:{
键入:“自适应卡”,
发言:“您关于“自适应卡设计会议”的会议将于下午12:30开始。您想打盹还是向与会者发送迟到通知?”,
正文:[
{
“类型”:“文本块”,
“文本”:“自适应卡设计会话”,
“大小”:“大”,
“重量”:“更大胆”
},
{
“类型”:“文本块”,
“案文”:“会议室112/3377(10)”
},
{
“类型”:“文本块”,
“文本”:“下午12:30-下午1:30”
},
{
“类型”:“文本块”,
“文本”:“打盹”
},
{
“类型”:“Input.ChoiceSet”,
“id”:“打盹”,
“风格”:“紧凑”,
“选择”:[
{
“标题”:“5分钟”,
“价值”:“5”,
“isSelected”:正确
},
{
“标题”:“15分钟”,
“值”:“15”
},
{
“标题”:“30分钟”,
“值”:“30”
}
]
}
],
“行动”:[
{
“类型”:“操作.提交”,
“标题”:“打盹”
},
{
“类型”:“操作.提交”,
“标题”:“我要迟到了”
}
]
}
});
如何在对话中显示它,以便bot等待用户单击其中一个提交按钮
我如何读取已按下的按钮
我在node.js中找不到任何这样做的示例
非常感谢您需要检查session.message.value是否存在
if (session.message && session.message.value) {
// process your card's submit action
}
查看以下内容,了解如何处理提交操作。哦,不link给出了一个404