Search code examples
c#botframeworkazure-bot-service

C# Bot Framework V4 Get UserInput


How do we get user type input in Bot Framework V4? in V3 i used the below

PromptDialog.Text(context, UserResponse, "Your Name Please?");

Once user enters the name , userResponse will get called. I am not able to find somthing like this in V4 , only waterflowdialog i am finding , Since i am using lots of PromptDialog.Text in my project it is not feasible to create dialogs for all text

Any Tips would be much appreciated.


Solution

  • You don't need to add waterfall dialogs all over the place just to use prompts. The example referenced in the comments above shows how you can use them in conjunction, but you can add prompts to a dialog set without waterfalls.

    enter image description here

    Then later, you can reference them like this:

    enter image description here

    The example show above is from the Botbuilder-Samples repo, specifically the 'Simple Prompts' C# sample. There are other samples that include prompts, such as multi-turn prompt, prompt validation and even cafe bot (if you look at the 'book table' intent)