Wolke / botbuilder-linebot-connector

MIT License
88 stars 16 forks source link

Does not reply message, no error visible / 程序既不回复信息,也不显示错误 #4

Closed austinhuang0131 closed 6 years ago

austinhuang0131 commented 6 years ago
2018-01-19T20:01:44.809942+00:00 heroku[router]: at=info method=POST path="/linebot" host=<Censored> request_id=6401d3b2-9897-467e-8940-94ff0de26d25 fwd=<Censored> dyno=web.1 connect=1ms service=5ms status=200 bytes=207 protocol=https
2018-01-19T20:01:44.806314+00:00 app[web.1]: event { type: 'message',
2018-01-19T20:01:44.806329+00:00 app[web.1]:   replyToken: 'bce62e26791b4b5893d298f9e45a7121',
2018-01-19T20:01:44.806331+00:00 app[web.1]:   source: { userId: 'U74e92ce16051d4b129c5f866e230f58b', type: 'user' },
2018-01-19T20:01:44.806332+00:00 app[web.1]:   timestamp: 1516392104124,
2018-01-19T20:01:44.806333+00:00 app[web.1]:   message: { type: 'text', id: '7337750864733', text: 'about' } }

In the script, I set up the connector like the following / 程序内的Line链接则以如下方式设置:

var builder = require('botbuilder');
var connector = new builder.ChatConnector({
    appId: process.env.appid,
    appPassword: process.env.appkey
});
var LineConnector = require("botbuilder-linebot-connector");
var lineConnector = new LineConnector.LineConnector({
    hasPushApi: false,
    channelId: process.env.line1,
    channelSecret: process.env.line2,
    channelAccessToken: process.env.line3
});
bot.connector("line", lineConnector);
...
server.post('/linebot', lineConnector.listen()); // Express

注:可以直接用繁体回复。

Wolke commented 6 years ago

你是用js喔! 因為我現在都寫ts, 我研究一下先。

Wolke commented 6 years ago

補上 js 範例 code 了

austinhuang0131 commented 6 years ago

似乎不是这个问题。目前.listen()能收到消息并发到bot.on("message"上面,但是Line消息不能启动Session。注意机器人是Skype和Line兼用的。

The problem is not that. Currently, the listener can receive messages and trigger a Message event, but they don't go into sessions. Note that the bot is used on both Skype and Line.