Ich habe kürzlich einen Chatbot mit Microsoft Botframework entwickelt. Ich benutze prompt.confirm, um die Ja/Nein-Eingabe des Benutzers zu nehmen, aber es zeigt zu viele Versuche, Ausnahme, wenn ich Basic Ja/Nein schreibe. Ich möchte nicht, dass mein Bot zu viele Versuche ausgibt Ausnahme, stattdessen möchte ich es intern behandeln. Hier ist mein Code.C# BotFramework Prompt.Confirm zeigt zu viele Versuche an Ausnahme
[LuisIntent("None")]
public async Task NoneIntent(IDialogContext context, LuisResult result)
{
try
{
PromptDialog.Confirm(context, NextQuestionAsync, QuestionPrompt, attempts: 1, promptStyle: PromptStyle.Auto);
}
catch (Exception ex)
{
await context.PostAsync("Something really bad happened.");
}
}
public async Task NextQuestionAsync(IDialogContext context, IAwaitable<bool> result)
{
try
{
if (await result)
{
await context.PostAsync($"Ok, alarm 0 disabled.");
//context.Wait(NoneIntent);
}
else
{
await context.PostAsync("You Said No");
}
}
catch (Exception e)
{
}
}
https://github.com/Microsoft/BotBuilder/issues/1757 – stuartd