如何从 Microsoft Health BOT 收集用户信息

How to collect user information from Microsoft Health BOT

我正在使用 Microsoft BOT Framework v4 开发一个机器人。我想在聊天过程中收集用户信息和一些问题的答案。我读了一些看起来很复杂的文章,因为它们使用用户配置文件class等

我想知道是否有更简单的方法来做到这一点?有没有办法从卡或自适应卡中收集数据?

如有任何帮助,我们将不胜感激。

您可以使用瀑布对话框,从中获取用户所需的信息。

您可以使用适配卡片的输入表单。

例如:

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": 2,
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "Tell us about yourself",
                            "weight": "Bolder",
                            "size": "Medium"
                        },
                        {
                            "type": "TextBlock",
                            "text": "We just need a few more details to get you booked for the trip of a lifetime!",
                            "isSubtle": true,
                            "wrap": true
                        },
                        {
                            "type": "TextBlock",
                            "text": "Don't worry, we'll never share or sell your information.",
                            "isSubtle": true,
                            "wrap": true,
                            "size": "Small"
                        },
                        {
                            "type": "TextBlock",
                            "text": "Your name",
                            "wrap": true
                        },
                        {
                            "type": "Input.Text",
                            "id": "myName",
                            "placeholder": "Last, First"
                        },
                        {
                            "type": "TextBlock",
                            "text": "Your email",
                            "wrap": true
                        },
                        {
                            "type": "Input.Text",
                            "id": "myEmail",
                            "placeholder": "youremail@example.com",
                            "style": "Email"
                        },
                        {
                            "type": "TextBlock",
                            "text": "Phone Number"
                        },
                        {
                            "type": "Input.Text",
                            "id": "myTel",
                            "placeholder": "xxx.xxx.xxxx",
                            "style": "Tel"
                        }
                    ]
                },
                {
                    "type": "Column",
                    "width": 1,
                    "items": [
                        {
                            "type": "Image",
                            "url": "https://upload.wikimedia.org/wikipedia/commons/b/b2/Diver_Silhouette%2C_Great_Barrier_Reef.jpg",
                            "size": "auto"
                        }
                    ]
                }
            ]
        }
    ],
    "actions": [
        {
            "type": "Action.Submit",
            "title": "Submit"
        }
    ]
}