请指导我。怎么了。我有用于其他对话的地方的菜单选项,并且运作良好。但在下面的代码中它不起作用。
bot.dialog('/My Subscriptions', [
function (session, args) {
session.send('My Subscriptions Menu');
session.userData.profile.CurrntSubscriptionsView = true;
displaytheSubscriptions(session);
},
]);
function displaytheSubscriptions(session)
{
var subscribedArray = '';
var indexVal = 1;
for(var i in selectedSubArray) {
//console.log (i, selectedSubArray[i]);
subscribedArray += indexVal+'. '+selectedSubArray[i]+'\n';
indexVal++;
}
if (subscribedArray.length > 0) {
builder.Prompts.text(session, "Subscriptions List\n\n"+subscribedArray);
} else {
session.send(wrongMsg);
}
session.send("flag is "+session.userData.profile.CurrntSubscriptionsView);
if(session.userData.profile.CurrntSubscriptionsView === true) {
session.send('You will be redirecting you to previous menu.');
session.replaceDialog('/menu');
} else {
builder.Prompts.text(session, "Select your Unsubscriptions [ Multiple selectation seperate by comma (,) ]?");
}
}
bot.dialog('/Unsubscribe', [
function (session, args) {
session.send('Unsubscribe Menu');
session.userData.profile.CurrntSubscriptionsView = false;
displaytheSubscriptions(session);
},
function(session, results) {
session.send(results.response);
if(results.response.entity != '') {
session.send("You entered '%s'", results.response);
session.userData.profile.CurrntSubscribeList = results.response;
session.beginDialog('/Confrim Unsubscribe');
}
}
]);
当我选择取消订阅菜单时,它可以正常工作,但是当我从选项中选择我的订阅菜单选项时。它让我回答了机器人和机器人的错误skype
Skype向我显示消息" 糟糕。出了点问题,我们需要重新开始。"
和Bot告诉我错误。
restify listening to http://[::]:3978
Error: Dialog[BotBuilder:/menu] not found.
at Session.replaceDialog (node_modules/botbuilder/lib/Session.js:188:19)
at displaytheSubscriptions (start.js:1701:17)
at Array.<anonymous> (start.js:1680:9)
at SimpleDialog.waterfallAction [as fn] (node_modules/botbuilder/lib/dialogs/DialogAction.js:131:25)
at SimpleDialog.begin (node_modules/botbuilder/lib/dialogs/SimpleDialog.js:15:14)
at Session.beginDialog (node_modules/botbuilder/lib/Session.js:180:16)
at Array.<anonymous> (start.js:324:25)
at SimpleDialog.waterfallAction [as fn] (node_modules/botbuilder/lib/dialogs/DialogAction.js:117:32)
at SimpleDialog.dialogResumed (node_modules/botbuilder/lib/dialogs/SimpleDialog.js:21:14)
at Session.endDialogWithResult (node_modules/botbuilder/lib/Session.js:279:28)