I am trying to call a dialog from my luis intent. But I am getting error. please check my code.It reaches the UserInteraction dialog but the control does not go to Getuserpurpose.It shows an error "my bot code is having an issue"
I tried debugging and I found out that the control transfers to Webapi config class after StartAsync Task.
[LuisIntent("Getfile")]
public async Task GetfileIntent(IDialogContext context, LuisResult result)
{
await context.PostAsync("Sure we can help you on that... ");
//PromptDialog.Text(context, UserEnteredInfo, "can you please provide us with below info. " +
// "Purpose" + "Client name" + "Team Name");
await context.PostAsync("But first i need to know the purpose ");
// Conversation.SendAsync(Activity, () => new UserInteraction());
context.Call(new UserInteraction(),ResumeAfterFeedback);
}
private async Task ResumeAfterFeedback(IDialogContext context, IAwaitable<object> result)
{
await context.PostAsync("Prepared an email for you");
context.Wait(MessageReceived);
}
[Serializable]
public class UserInteraction : IDialog<object>
{
protected string Purpose { get; set; }
protected string ClientName { get; set; }
protected string Teamname { get; set; }
public async Task StartAsync(IDialogContext context)
{
await context.PostAsync("Please enter the purpose");
// context.Wait(this.MessageReceivedAsync);
context.Wait(Getuserpurpose);
}
public async Task Getuserpurpose(IDialogContext context, IAwaitable<IMessageActivity> argument)
{
var message = await argument;
this.Purpose = message.Text;
await context.PostAsync("Now please tell me the client name");
context.Wait(Getuserclient);
}