node.js - 中断后返回瀑布对话框
问题描述
在使用 Luis 检测到中断后,我在尝试返回瀑布对话框时遇到问题。例如,我的瀑布中有 5 个步骤,在第 3 步中 Luis 检测到中断并正确回答,但瀑布返回第 4 步并且不再询问第 3 步。
async interrupt(innerDc) {
if (innerDc.context.activity.text) {
const luisResult = await this.luisRecognizer.executeLuisQuery(innerDc.context);
switch (LuisRecognizer.topIntent(luisResult)) {
case 'TiempoDesembolso':
const getWeatherMessageText = 'El tiempo de desembolso actual es de 12 meses';
await innerDc.context.sendActivity(getWeatherMessageText, getWeatherMessageText, InputHints.IgnoringInput);
return await this.onContinueDialog(innerDc);
}
}
我怎样才能再次要求第 3 步,然后继续瀑布流?
解决方案
您应该能够return await innerDc.repromptDialog();
在您的案例语句中使用来重新提示活动对话框的最后一步。我使用了旧版本,它在我的主 dispatchBot.js 文件中包含中断代码,而不是单独的 cancelAndHelpDialog 文件,但我认为方法是相同的。
推荐阅读
- c# - 如何使用 Visual Basic 将数据从 txt 文件传输到 DataGridView
- java - 在时间戳之间从 Firebase 检索数据
- javascript - 渲染 Big React 日历时出现控制台错误
- javascript - 如何访问 JS 对象中嵌套项的索引?
- ios - 观察员被过度释放或被砸
- telegram-bot - 为什么我不能通过它的 id 发送贴纸
- python - 编译时的 DEF 变量 + 强制转换 - Cython
- powershell - 在 AD 中查找用户
- python - 如何优化 TensorFlow CNN?
- php - 单击提交按钮时,自定义 wordpress 注册页面重定向到 404 页面未找到