Is there a way to enable calendar option as an input in V4 chat bot C# other than using Adaptive cards?

后端 未结 1 1893
别跟我提以往
别跟我提以往 2021-01-24 00:33

Is there a way to enable Date and Time input in other words calendar options in Chat Bot without using Adaptive cards as i understand from below link the Adaptive cards are not

相关标签:
1条回答
  • 2021-01-24 01:18

    The short answer is that this feature isn't available. Adaptive Cards are the best route to go for any kind of UI-based date/time picker. And yes, Adaptive Cards are fully supported on Microsoft channels (which includes WebChat), and less so on other channels.

    The best option you have would be to use the DateTime Prompt.

    There's a lot of different methods with varying complexity to implement this, but the Virtual Assistant Calendar Skill uses it pretty extensively. Its DatePrompt and TimePrompt might be good places to start.

    CoreBot also has a DateResolverDialog that may help and is a little easier to understand.


    DateTime is pretty complex to work with in chat bots because "Wednesday at 4 o'clock" can mean Wednesday at 4AM or 4PM. The Timex Resolution Sample should provide additional ideas for dealing with this, if you're going with a text-based input.


    It's possible that this isn't working for you in WebChat because of your other issue. I just tested the Date and Time inputs for this card and it's working:

    {
        "type": "AdaptiveCard",
        "actions": [{
            "type": "Action.Submit",
            "id": "submit",
            "title": "Submit"
        }],
        "body": [
            {
                "type": "Input.Date",
                "id": "date",
                "title": "New Input.Toggle"
            },
            {
                "type": "Container",
                "items": [
                    {
                        "type": "Input.Time",
                        "id": "time",
                        "title": "New Input.Toggle"
                    }
                ]
            }
        ],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.0"
    }
    

    0 讨论(0)
提交回复
热议问题