我有一个带有CompleteAsync函数的Maindialog,它在子对话框调用stepContext.EndDialogAsync();
protected override async Task CompleteAsync(DialogContext dc, DialogTurnResult result = null, CancellationToken cancellationToken = default(CancellationToken))
{
await _responder.ReplyWith(dc.Context, MainResponses.ResponseIds.NewUserGreeting);
await dc.BeginDialogAsync(nameof(ProductFlowDialog));
}
在触发时,从不会调用子对话框的瀑布的初始步骤。
为了暂时解决此问题,我将await dc.BeginDialogAsync(nameof(ProductFlowDialog))
调用移到了routeAsync函数中。
protected override async Task CompleteAsync(DialogContext dc, DialogTurnResult result = null, CancellationToken cancellationToken = default(CancellationToken))
{
await _responder.ReplyWith(dc.Context, MainResponses.ResponseIds.Completed);
}
protected override async Task RouteAsync(DialogContext dc, CancellationToken cancellationToken = default(CancellationToken))
{
_responder = new MainResponses();
await _responder.ReplyWith(dc.Context, MainResponses.ResponseIds.NewUserGreeting);
await dc.BeginDialogAsync(nameof(ProductFlowDialog));
}
此解决方案的问题在于,最终用户必须在聊天中键入某些内容才能重新启动对话流。 我想在对话框流程结束时自动重新启动新的对话框流程。
答案 0 :(得分:0)
我们使用另一个Bot模板从头开始重新启动了dvt,此问题不再发生。绝对不知道它来自哪里