【发布时间】:2021-10-14 17:41:31
【问题描述】:
我在 Microsoft Teams 上使用 Microsoft Bot Framework 创建了一个机器人。对话结束后,我会使用以下自适应卡向用户询问反馈:
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"msteams": {
"width": "Full"
},
"body": [
{
"type": "Container",
"items": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Feedback",
"horizontalAlignment": "center",
"weight": "bolder",
"size": "large",
"isSubtle": true,
"color": "accent"
},
{
"type": "TextBlock",
"text": "What would you like to share with us?",
"horizontalAlignment": "center",
"weight": "bolder",
"isSubtle": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "ActionSet",
"actions": [{
"type": "Action.ToggleVisibility",
"title": "Question",
"targetElements": [
{
"elementId" : "Question",
"isVisible": true
},
{
"elementId" : "Suggestion",
"isVisible": false
},
{
"elementId" : "Comments",
"isVisible": false
}]
}]
}]
},
{
"type": "Column",
"items": [
{
"type": "ActionSet",
"actions": [{
"type": "Action.ToggleVisibility",
"title": "Suggestion",
"targetElements": [
{
"elementId" : "Question",
"isVisible": false
},
{
"elementId" : "Suggestion",
"isVisible": true
},
{
"elementId" : "Comments",
"isVisible": false
}]
}]
}]
},
{
"type": "Column",
"items": [
{
"type": "ActionSet",
"actions": [{
"type": "Action.ToggleVisibility",
"title": "Comments",
"targetElements": [
{
"elementId" : "Question",
"isVisible": false
},
{
"elementId" : "Suggestion",
"isVisible": false
},
{
"elementId" : "Comments",
"isVisible": true
}]
}]
}]
}]
},
{
"type": "Input.Text",
"id": "Question",
"placeholder": "Enter Your Question...",
"maxLength": 500,
"isMultiline": true,
"isVisible": true
},
{
"type": "Input.Text",
"id": "Suggestion",
"placeholder": "Give Your Suggestion...",
"maxLength": 500,
"isMultiline": true,
"isVisible": false
},
{
"type": "Input.Text",
"id": "Comments",
"placeholder": "Give Your Feedback...",
"maxLength": 500,
"isMultiline": true,
"isVisible": false
},
{
"type": "ActionSet",
"actions": [{
"type": "Action.Submit",
"title": "Submit Feedback",
"data": {
"msteams": {
"type": "imBack",
"value": "Feedback Submitted."
}
},
"style": "positive"
}]
}]
}]
}]
}
因此,一旦用户选择了三个选项中的任何一个 Question 、 Suggestion 、 Comments 并将反馈添加到 Input.Text 框中,我想获取该信息并将其发送回用户聊天。我如何做到这一点?
【问题讨论】:
标签: node.js botframework microsoft-teams