我正在尝试从另一个对话框 js 文件中执行 begindialog。我收到错误。
<b>[onTurnError]: Error: DialogContext.beginDialog(): A dialog with an id of 'FollowUpDialog' wasn't found. </b>
这是对话结构-
- 对话
- 订单状态
- orderstatus.js
- index.js
- 跟进
- 跟进.js
- index.js
- 订单状态
我正在尝试在 OrderStatus 对话框中包含 FollowUp 对话框,类似地,我还有其他要开始跟进或 orderstatus 对话框的对话框。试图重用对话框。
一种使用我们如何将文件包含在 botjs amd 中的方法来执行 adddialog,就像我可以包含在 otherfile 中一样。但这是多余的工作。我试图避免这种情况。有人能告诉我更好的方法来将对话包含在不同的对话中吗?
代码:
下面的代码来自 greeting.js 如果你看到我正在做 begindialog 的那一行。
返回等待 step.beginDialog(ORDER_STATUS_DIALOG); 返回等待 step.beginDialog(ENTITLEMENT_CHECK_DIALOG);
这是错误。我正在尝试包含作为不同 JS 文件一部分的对话框。
async step => {
if (step.context.activity.channelId == 'directline') {
const buttons = [{
type: ActionTypes.ImBack,
title: 'Repair Order Status',
value: symbolicString.ZEB_GR_STR_013
}, {
type: ActionTypes.ImBack,
title: 'Entitlement Check',
value: symbolicString.ZEB_GR_STR_014
}];
const card = CardFactory.heroCard('', undefined, buttons, {
text: symbolicString.ZEB_GR_STR_015
});
const reply = {type: ActivityTypes.Message};
reply.attachments = [card];
return await step.context.sendActivity(reply);
} else {
return await step.prompt(MENU_PROMPT, symbolicString.ZEB_GR_STR_028);
}
},
async step => {
if (step.context.activity.channelId != 'directline'){
console.log("step greeting dialog next step");
console.log(step);
console.log(step.context.activity);
if (step.context.activity.text == '1'){
return await step.beginDialog(ORDER_STATUS_DIALOG);
}else if (step.context.activity.text == '2'){
return await step.beginDialog(ENTITLEMENT_CHECK_DIALOG);
}
}
return await step.endDialog();
}
]));