我要猜一个答案;如果你读过
https://docs.microsoft.com/en-us/cortana/skills/adaptive-cards
那么您的问题可能是“嗯,响应是什么样的?”我同意,这在文档中并不清楚。
当您单击 submit.action 时,您将在消息负载中返回所有 id 和值。例如,如果您查看此处的输入示例https://adaptivecards.io/samples/Inputs.html
您对点击的响应消息是这样的
{"SimpleVal":"My name","UrlVal":"","EmailVal":"","TelVal":"","MultiLineVal":"","NumVal":"1","DateVal":"2017-09-20","TimeVal":"16:59","CompactSelectVal":"1","SingleSelectVal":"1","MultiSelectVal":"1;3","AcceptsTerms":"on","CommentVal":""}
您的技能应该足够聪明,可以将 message.text 识别为 json,然后使用表单字段中的 id 来收集值。
请注意,Cortana 在返回自适应卡片结果的方式上略有不同。其他频道将为消息附加一个值,因此如果您想支持多个频道...
if( session.message.text && session.channel === 'cortana' )
{ ... digest the json in the message ... }
if( session.message.value )
{ ... digest the values attached to the message for non-cortana ... }
另外请注意,您也可以将数据添加到可以在有效负载中发送的操作
{
"type": "Action.Submit",
"title": "Submit",
"data": {
"id": "1234567890"
}
},