何时调用RetryPrompt对话框?

时间:2018-10-10 10:35:29

标签: c# .net-core dialog botframework prompt

抱歉引起了这个问题,可能不是很好。

例如,我在添加TextPrompt时尝试使用验证器

AddDialog(new TextPrompt(ServerPrompt, Validator));

Validator函数返回Task<bool>。 并希望当验证失败时,将调用RetryPrompt

但是不。

机器人只重试了ActiveDialog,没有其他任何事情。 我只是希望将一条有用的消息发送给用户,给他一些有用的建议。

// Create prompt opts to prompt for the server name
var opts = new PromptOptions {
    Prompt = MessageFactory.Text("Which Server?"),
    RetryPrompt = MessageFactory.Text("May you enter wrong thing, please check again!"),
};

非常感谢您阅读。

1 个答案:

答案 0 :(得分:0)

当Validator的结果Task<bool>为假时。