botframework - 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!
解决方案
我想你可能误解了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 这样的事件是特定于通道的,并且可能在不同的通道上以意想不到的方式表现。
推荐阅读
- module - 如何编写 use 语句以导入名称但将其用作 mod1::mod2::item?
- reporting-services - 基于 SSRS 中用户安全级别的列可见性
- python - 将日期四舍五入到最接近的半年
- vb.net - 如何模拟鼠标移动并单击Excel工作表中的特定单元格
- php - 是否可以将 PHP 扩展转移到另一台 PC?
- python - 如何使用 python 子进程使用 shell 'source' 命令
- java - 如何注册在 Android (Java) 中按住的键盘键并采取相应措施
- hyperledger-fabric - Hyperledger Fabric 上的 FabCar 示例
- json - 将索引添加到 json 文件以从 firebase 获取数据时出错。无效的 JSON。键不能为空或包含 $ # [ ] / 或
- swift - 在 deinit 期间首次访问引用 self 的惰性 var 时避免崩溃