为什么机器人消息不发送?

时间:2016-12-25 06:51:59

标签: node.js cloud9-ide botframework botconnector

我使用c9作为我的开发环境,当在开发中运行时,即使调用了send.batch,机器人也不会实际发送消息。

var bot = new builder.UniversalBot(connector);

bot.dialog('/', function (session) {
  session.send('Alec said ' + session.message.text);
});
function status(request,reply){
 connector.listen(request.raw.req,request.raw.res);
 return reply("ok");
}
  if (useEmulator) {
   var restify = require('restify');
   var server = restify.createServer();
   server.listen(8080, function() {
     console.log('test bot endpont at http://localhost:8080/api/messages');
   });
   server.post('/api/messages', connector.listen());  
} else {
  module.exports = { default: connector.listen() }
}

这是用于实现服务器的代码,从azure bot设置中获取,我将端口编辑为c9无法使用默认端口。

results after sending a message through emulator

1 个答案:

答案 0 :(得分:0)

似乎使用cloud 9服务器不允许我发送响应消息我的解决方案是ssh到我自己的服务器,此时应用程序将按预期工作。

相关问题