C# Bot Framework V4 Get UserInput

╄→гoц情女王★ 提交于 2020-01-06 07:08:52

问题


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.


回答1:


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.

Then later, you can reference them like this:

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)



来源:https://stackoverflow.com/questions/55029213/c-sharp-bot-framework-v4-get-userinput

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!