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

message to user after maximum attempts in PromptDialog

Open eddie1976 opened this issue 10 years ago • 1 comments

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 message) { T result;

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();
    }
}

}

eddie1976 avatar May 09 '16 13:05 eddie1976

Commit d77f719 adds this feature.

msft-shahins avatar May 10 '16 19:05 msft-shahins