C#Bot Framework V4获取UserInput [英] C# Bot Framework V4 Get UserInput

查看:68
本文介绍了C#Bot Framework V4获取UserInput的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Bot Framework V4中获取用户类型输入?在V3中,我使用了以下

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

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

一旦用户输入名称,就会调用userResponse.我无法在V4中找到类似的东西,只能找到waterflowdialog,因为我在项目中使用了很多PromptDialog.Text,因此无法为所有文本创建对话框

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

任何提示将不胜感激.

推荐答案

您无需在整个地方添加瀑布对话框即可使用提示.上面的注释中引用的示例显示了如何结合使用它们,但是您可以向没有瀑布的对话框集中添加提示.

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:

上面的示例来自 Botbuilder-Samples存储库,特别是简单提示" C#示例.还有其他包含提示的示例,例如多轮提示,提示验证,甚至是咖啡馆机器人(如果您查看书桌"的意图)

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)

这篇关于C#Bot Framework V4获取UserInput的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆