How to insert into the root dialog with the base of bots?

I use the .Net backend for my bot, based on the structure of the bot. In one of my dialogs, I give the user the opportunity to return to the root dialog - or at least to what I'm trying to do, but not to success. Here is what I have already tried:

  • call context.Reset()- I found out that I cannot use this from inside a dialog box; it causes a failure
  • Conversation.SendAsync((IMessageActivity)context.Activity, () => new RootDialog()) - doing nothing

Ideally, I just want to go back to the first on the stack without the need for hard type coding RootDialog.

+4
source share
1 answer

As pointed out by Ezequiel, context.Done () is how to end the current dialog and return control to the calling dialog.

https://docs.botframework.com/.../sdkreference/dialog_stack.html

void Microsoft.Bot.Builder.Dialogs.Internals.IDialogStack.Done( R)

.

 value: The value of the result.
+2

Source: https://habr.com/ru/post/1682337/


All Articles