Bot Framework V4 Dialog wait for user input withou

2019-08-18 03:20发布

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".

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.

2条回答
疯言疯语
2楼-- · 2019-08-18 04:10

you can return waiting result like this:

return new DialogTurnResult(DialogTurnStatus.Waiting);
查看更多
3楼-- · 2019-08-18 04:11

To achieve wait behavior without prompting user with the text, you can use send empty prompt like this:

 return await stepContext.PromptAsync("<emptyPrompt>", new PromptOptions { }, cancellationToken);
查看更多
登录 后发表回答