1
votes

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!

1
So your root dialog is a LUIS dialog? Is CustomBellaHelp your root dialog? When you say Direct Channel do you mean Direct Line? Are you responding to ConversationUpdate events? I think I will need to see the rest of your code in order to help you.Kyle Delaney
Thanks Kyle. To your questions: CustomBellaHelp is not my root dialog. It's optionally called by the message controller in the beginning of the conversation. Sorry, I meant Direct Line ;) Yes, I'm responding to ConversationUpdate. The code is available at onedrive.live.com/… Thanks in advance!Amintas Lopes Neto

1 Answers

2
votes

I think you may be misunderstanding the purpose of Conversation.SendAsync(). The MakeRoot delegate isn't a function to navigate to whatever dialog you want. It's only called at the start of the conversation and it's used to create the conversation's root dialog. If a conversation is already underway, Conversation.SendAsync() sends the activity to whatever dialog is on top of the stack and the MakeRoot delegate is ignored. You can read more about dialogs and conversation flow here: https://docs.microsoft.com/en-us/azure/bot-service/bot-service-design-conversation-flow?view=azure-bot-service-3.0

If you want to start a dialog in the middle of a conversation you should do it from within another dialog and not from your messages controller. A typical way of doing this is to use 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

As far as why Direct Line behaves differently from the emulator, you have to understand that events like conversationUpdate are channel-specific and may behave in unexpected ways on different channels.