When I try to use PromptDialog.Confirm, I get this error. The code:
`
[LuisIntent("Define")]
public async Task Define(IDialogContext context, LuisResult result)
{
PromptDialog.Confirm(context, AfterConfirming_TurnOffAlarm, "Are you sure?");
context.Wait(MessageReceived);
}
public async Task AfterConfirming_TurnOffAlarm(IDialogContext context, IAwaitable
{
if (await confirmation)
{
await context.PostAsync($"Ok, alarm disabled.");
}
else
{
await context.PostAsync("Ok! We haven't modified your alarms!");
}
context.Wait(MessageReceived);
}
}
`
You only need to use PromptDialog.Confirm or context.Wait(MessageReceived) not both - the prompt dialog itself will call context.Wait(MessageReceived) internally.
I'm going to close this issue - feel free to re-open to discuss.
I am getting invalid need exception when I iterated a for each loop over a JSON object(two-dimensional). I want to display the keys in JSON object one after another and also had to wait for response from user after every question. I getting this exception first and after that the first question is displayed. I am using choice selection and confirmation dialogs for every question. Can anyone suggest me a solution.
Most helpful comment
You only need to use PromptDialog.Confirm or context.Wait(MessageReceived) not both - the prompt dialog itself will call context.Wait(MessageReceived) internally.