由于您正在实例化
UniversalBot
上课两次:
var luisAppUrl = process.env.LUIS_APP_URL // etc
var bot = new builder.UniversalBot(connector);
var bot = new builder.UniversalBot(connector, function(session, args, next) {
session.send('How can i help you ?')
session.endDialog();
next();
});
尝试删除第一个
bot
因此,您的代码只是:
var luisAppUrl = process.env.LUIS_APP_URL // etc
var bot = new builder.UniversalBot(connector, function(session, args, next) {
session.send('How can i help you ?')
session.endDialog();
next();
});
编辑:
到达
'Location'
对话框中,您需要添加一个
triggerAction()
给你的
dialog
bot.dialog('Location', [
function (session, args, next) {
// ...
},
function(session, results) {
// ...
}
]).triggerAction({
matches: 'Location' // What your intent from LUIS is called.
}).cancelAction({
matches: /^(cancel|nevermind)/i,
confirmPrompt: "Are you sure?"
});