是的。使用context.Call()
或context.Forward()
可以在对话框之间切换。请看this sample project
通常人们做的是根对话的上下文根路径到另一个对话。下面是我认为根源在哪里对话框使用context.Call()
方法路由到另一个对话框样品的例子:
private async Task SendWelcomeMessageAsync(IDialogContext context)
{
await context.PostAsync("Hi, I'm the Basic Multi Dialog bot. Let's get started.");
context.Call(new NameDialog(), this.NameDialogResumeAfter);
}
您必须提供当被叫对话已完成了关闭触发方法后,一份简历。在样本它看起来像这样:
private async Task NameDialogResumeAfter(IDialogContext context, IAwaitable<string> result)
{
try
{
this.name = await result;
context.Call(new AgeDialog(this.name), this.AgeDialogResumeAfter);
}
catch (TooManyAttemptsException)
{
await context.PostAsync("I'm sorry, I'm having issues understanding you. Let's try again.");
await this.SendWelcomeMessageAsync(context);
}
}
[微软BOT框架处理多个对话]的可能的复制(https://stackoverflow.com/questions/37169371/handling-multiple-dialogs-in-microsoft-bot -framework) –