김대욱

wish3

Showing 1 changed file with 16 additions and 1 deletions
......@@ -26,8 +26,23 @@ app.post('/hook', function (req, res) {
console.log('[request message]', eventObj.message);
var cmd = message.text;
console.log('[command]',cmd);
console.log('[command]', cmd);
res.sendStatus(200);
});
app.post('/hook', function (req, res) {
var eventObj = req.body.events[0];
var source = eventObj.source;
var message = eventObj.message;
// request log
console.log('======================', new Date() ,'======================');
console.log('[request]', req.body);
console.log('[request source] ', eventObj.source);
console.log('[request message]', eventObj.message);
if(cmd == "영어"){
transen(eventObj.replyToken, eventObj.message.text);
}
......