Node.js Skype与节点集成错误-[TypeError:无法读取未定义的属性';记录器']
我正在使用skype客户端的bot应用程序。 服务器一收到第一条消息,就在服务器日志中发现(内部)错误 示例代码Node.js Skype与节点集成错误-[TypeError:无法读取未定义的属性';记录器'],node.js,botframework,skype-bots,Node.js,Botframework,Skype Bots,我正在使用skype客户端的bot应用程序。 服务器一收到第一条消息,就在服务器日志中发现(内部)错误 示例代码 var restify = require('restify'); var builder = require('botbuilder'); var calling = require('botbuilder-calling'); //========================================================= // Bot Setup //=
var restify = require('restify');
var builder = require('botbuilder');
var calling = require('botbuilder-calling');
//=========================================================
// Bot Setup
//=========================================================
// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});
// Create chat bot
var chatConnector = new builder.ChatConnector({
appId: process.env.MICROSOFT_APP_ID,
appPassword: process.env.MICROSOFT_APP_PASSWORD
});
var chatBot = new builder.UniversalBot(chatConnector);
server.post('/api/messages', chatConnector.listen());
// Create calling bot
var connector = new calling.CallConnector({
callbackUrl: 'https://<your host>/api/calls',
appId: process.env.MICROSOFT_APP_ID,
appPassword: process.env.MICROSOFT_APP_PASSWORD
});
var callingBot = new calling.UniversalCallBot(connector);
server.post('/api/calls', connector.listen());
//=========================================================
// Chat Dialogs
//=========================================================
// Add root dialog
chatBot.dialog('/', function (session) {
session.send('Hi... Please call me to interact with me.');
});
callingBot.dialog('/', function (session) {
session.send('Watson... come here!');
});;
预期行为
你期望会发生什么。
我希望skype客户端会收到聊天机器人和呼叫机器人的响应
实际结果
发生了以下错误
/home/marcus/advbot/node_modules/botbuilder/node_modules/promise/lib/done.js:10
throw err;
^
TypeError: Cannot read property 'logger' of undefined
at UniversalBot.Library.findActiveDialogRoutes (/home/marcus/advbot/node_modules/botbuilder/lib/bots/Library.js:135:20)
at /home/marcus/advbot/node_modules/botbuilder/lib/bots/Library.js:243:31
at /home/marcus/advbot/node_modules/botbuilder/node_modules/async/lib/async.js:718:13
at async.forEachOf.async.eachOf (/home/marcus/advbot/node_modules/botbuilder/node_modules/async/lib/async.js:233:13)
at _parallel (/home/marcus/advbot/node_modules/botbuilder/node_modules/async/lib/async.js:717:9)
at Object.async.parallel (/home/marcus/advbot/node_modules/botbuilder/node_modules/async/lib/async.js:731:9)
at /home/marcus/advbot/node_modules/botbuilder/lib/bots/Library.js:241:23
at UniversalBot.Library.recognize (/home/marcus/advbot/node_modules/botbuilder/lib/bots/Library.js:68:13)
at UniversalBot.Library.defaultFindRoutes (/home/marcus/advbot/node_modules/botbuilder/lib/bots/Library.js:236:14)
at UniversalBot.Library.findRoutes (/home/marcus/advbot/node_modules/botbuilder/lib/bots/Library.js:85:18)
marcus@AppBuilderBot:~/advbot/calling$ A
我已经解决了这个问题
bot.use(builder.Middleware.dialogVersion({ version: 1.0, resetCommand: /^reset/i }));
正如我在中所读到的,我已经在我的文件中使用了这行代码,但运气不好,skype和FB客户端对我的ABC帐户给出了相同的错误,但它与另一个帐户一起工作。
bot.use(builder.Middleware.dialogVersion({ version: 1.0, resetCommand: /^reset/i }));