C# BotFramework Prompt.Confirm displays too many attempts exception

前端 未结 2 519
一个人的身影
一个人的身影 2020-12-20 04:35

I was recently developing a chatbot using Microsoft\'s botframework. I am using prompt.confirm to take user\'s yes/no input but it shows too many attempts exception when I

2条回答
  •  青春惊慌失措
    2020-12-20 05:23

    I resolved this issue by overriding the PromptOptions constructor, Thanks to ezequiel. I used PromptDialog.Choice to achieve it however I could also have done it with confirm. Here's what I did

        List questions = new List();
        questions.Add("Yes"); // Added yes option to prompt
        questions.Add("No"); // Added no option to prompt
        string QuestionPrompt = "Are you sure?";
        PromptOptions options = new PromptOptions(QuestionPrompt, "", "", questions, 1); // Overrided the PromptOptions Constructor.
       PromptDialog.Choice(context, NextQuestionAsync, options);
    

提交回复
热议问题