botframework-sdk
botframework-sdk copied to clipboard
message to user after maximum attempts in PromptDialog
Now user will see "too many attempts" after maximum attempts. Can we change it in the next code release? Thanks!
private async Task MessageReceived(IDialogContext context, IAwaitable
if (this.TryParse(await message, out result))
{
context.Done(result);
}
else
{
--this.attempts;
if (this.attempts > 0)
{
var retry = this.retry ?? this.DefaultRetry;
await context.PostAsync(retry);
context.Wait(MessageReceived);
}
else
{
await context.PostAsync("too many attempts");
throw new Exception();
}
}
}
Commit d77f719 adds this feature.