本文介绍了Bot Framework V4对话框等待用户输入而不会提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Bot Framework V3中,提供了Context.Wait()方法,该方法提供了一种如何在对话框中等待用户输入而不必提示用户输入的方法.典型的情况是,当您使用HeroCard答复时,您只是在等待用户的反应而没有发送诸如请从选项中选择"之类的紧急消息.

In Bot Framework V3 there was method Context.Wait() which provided a way how to wait for user input within dialog without necessarily prompting user for input. Typical scenario, is when you reply with HeroCard and you just wait for user's reaction, without sending pushy message like: "Please choose form the options".

在V4中,我无法找到要查找的context.Wait()和stepContext wait方法,因此,此行为的实现需要轻而易举地找到,请参见下文.也许有更好的方法可以实现它,如果您共享它,将感到高兴.

In V4 I was not able to find to find context.Wait() respectively stepContext wait method, and so implementation of this behavior needed light walk around, provided in answer bellow. Maybe there is some better way ho to achieve it and will be glad if you share it.

推荐答案

您可以返回等待结果,如下所示:

you can return waiting result like this:

return new DialogTurnResult(DialogTurnStatus.Waiting);

这篇关于Bot Framework V4对话框等待用户输入而不会提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 14:27