I\'m using PromptDialog.Choice()
to present different options to my users. The number of attempts is set to 0, so if they type in anything that is not a valid optio
Adding some more context to Ezequiel Jadib answer. I ran into a requirement similar to question mentioned in link below. Also, used one of the answer provided to the same question.
Calling back Luis from a forward dialog
Though the above question is marked as duplicate to current, I feel the Luis context is missing from this question.
If the Activity
is created without Channel
, From
and Recipient
information, you may end up with some exception while creating a reply. So, below code will help you create the right activity and set the correct message before handing it over to Luis
Luis Intent Method
[LuisIntent("PerformSearch")]
public async Task Search(IDialogContext context, IAwaitable activity, LuisResult result)
{
var msg = await activity;
msg.Value = result;
await context.Forward(new SearchDialog(), ResumeAfterSearchPerformed, msg, CancellationToken.None);
}
Resume After method for Forwarded Dialog
private async Task ResumeAfterSearchPerformed(IDialogContext context, IAwaitable
By doing above, you can easily create a reply from properly hydrated Activity
Activity reply = ((Activity)message).CreateReply();
reply.AttachmentLayout = AttachmentLayoutTypes.Carousel;