首页 > 解决方案 > Bot Framework Dialog Leakage Issue

问题描述

I've developed a bot that calls a prompt dialog based menu at the beginning of the conversation. Dialog call used on the Message Controller:

await Conversation.SendAsync(activity, () => new Dialogs.CustomBellaHelp());

The problem is when I execute it over the Bot Emulator prompt dialog options are properly addressed by the code. However, when I execute it over Direct Channel prompt dialog options "leak" from the dialog code and move to the Root dialog which invokes LUIS to manage the menu options. Thoughts on how to avoid that?

Thx!

标签: botframework

解决方案


我想你可能误解了Conversation.SendAsync(). MakeRoot 委托不是导航到您想要的任何对话框的功能。它仅在对话开始时调用,用于创建对话的根对话。如果对话已经在进行中,Conversation.SendAsync()则将活动发送到堆栈顶部的任何对话框,并忽略 MakeRoot 委托。您可以在此处阅读有关对话和对话流程的更多信息:https ://docs.microsoft.com/en-us/azure/bot-service/bot-service-design-conversation-flow?view=azure-bot-service-3.0

如果你想在对话中间开始一个对话,你应该在另一个对话中而不是从你的消息控制器中进行。这样做的典型方法是使用context.Forward()https ://docs.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-manage-conversation-flow?view=azure-bot- service-3.0#invoke-the-new-order-dialog

至于为什么 Direct Line 的行为与模拟器不同,您必须了解像 conversationUpdate 这样的事件是特定于通道的,并且可能在不同的通道上以意想不到的方式表现。


推荐阅读