I have below LUIS intent implementation -
[LuisIntent("MyIntent")]
public async Task MyIntent(IDialogContext context, IAwaitable<IMessageActivity> res, LuisResult result)
{
var message = await res;
try
{
await context.PostAsync("I see that you have below options <br/> 1. Do first task <br/> 2. Do second task <br/> 3. Do third task ");
PromptDialog.Text(context, taskdoer, "You can ask me like - <br/>Do task 2<br/>or simply enter 2");
}
catch (Exception e)
{
await context.PostAsync("Error is <br/> " + e.ToString());
context.Wait(MessageReceived);
}
}
And the definition for taskdoer -
private async Task taskdoer(IDialogContext context, IAwaitable<string> result)
{
string strTaskNumber = await result;
if (strTaskNumber == "2")
{
await context.PostAsync("So, you have entered " + strTaskNumber);
await context.PostAsync("This is Task 2");
context.Wait(MessageReceived);
}
if (strTaskNumber == "3")
{
await context.PostAsync("So, you have entered " + strTaskNumber);
await context.PostAsync("This is Task 3");
context.Wait(MessageReceived);
}
}
What I would like to achieve is that, without using new method - taskdoer, how can I implement taskdoer logic within MyIntent method itself, but with user prompt for the input as in taskdoer? Is any way user can be prompted without using PromptDialog in Microsoft bot?