botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

PromptDialog.Confirm issue with emulator

Open Sams4u opened this issue 10 years ago • 2 comments

Hi Team, Recently i see a problem with PromptOptions class when passed as a parameter to PromptDialog.Confirm. It is not taking the PromptStyler value when PromptOptions is passed as a parameter. Also the next overloaded method Confirm (IDialogContext context, ResumeAfter< bool > resume, string prompt, string retry=null, int attempts=3, PromptStyle promptStyle=PromptStyle.Auto) doesnot have the parameter to pass tooManyAttempts attribute value. My problem is that, i have to display a text when user exceeds the number of attempts. If i use the first mentioned Confirm methord which takes PromptOptions as the argument it is not evaluating the PromptStyler and so not showing the (Yes/No) string to the user. And if i am using the next overloaded method of Confirm it doesn't have the option to pass tooManyAttempts value as parameter. Please help!!!

Sams4u avatar Oct 26 '16 12:10 Sams4u

You can pass in the PormptStyler to the constructor of PromptOptions: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Dialogs/PromptDialog.cs#L157

and then use the following static helper to create your prompt dialog: https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Dialogs/PromptDialog.cs#L307

msft-shahins avatar Oct 27 '16 01:10 msft-shahins

Hi, I am following the same set of code. But it is not evaluating PromptStyler constructor.

PromptOptions<string> PromptOptions = new LUISLogic().GetPromptOption("Are you satisfied with the answer?");
PromptDialog.Confirm(context, FeedbackConfirm, PromptOptions);

public PromptOptions<string> GetPromptOption(string prompt) {
            return new PromptOptions<string>(
                    prompt,
                    $"Please respond(yes/no)!",
                    "It seems you are satisfied with the answer. Thannk you",
                    null,
                    0,
                    new PromptStyler(PromptStyle.Auto));
        }

Sams4u avatar Oct 27 '16 09:10 Sams4u