김대욱

wish

Showing 1 changed file with 5 additions and 4 deletions
...@@ -17,7 +17,6 @@ app.post('/hook', function (req, res) { ...@@ -17,7 +17,6 @@ app.post('/hook', function (req, res) {
17 17
18 var eventObj = req.body.events[0]; 18 var eventObj = req.body.events[0];
19 var source = eventObj.source; 19 var source = eventObj.source;
20 - var kind = eventObj.kind;
21 var message = eventObj.message; 20 var message = eventObj.message;
22 21
23 // request log 22 // request log
...@@ -26,13 +25,15 @@ app.post('/hook', function (req, res) { ...@@ -26,13 +25,15 @@ app.post('/hook', function (req, res) {
26 console.log('[request source] ', eventObj.source); 25 console.log('[request source] ', eventObj.source);
27 console.log('[request message]', eventObj.message); 26 console.log('[request message]', eventObj.message);
28 27
29 - if(request.get == "영어"){ 28 + const question = req.body.userRequest.utterance;
29 +
30 + if(question == "영어"){
30 transen(eventObj.replyToken, eventObj.message.text); 31 transen(eventObj.replyToken, eventObj.message.text);
31 } 32 }
32 - else if(request.get == "프랑스어"){ 33 + else if(question == "프랑스어"){
33 transfr(eventObj.replyToken, eventObj.message.text); 34 transfr(eventObj.replyToken, eventObj.message.text);
34 } 35 }
35 - else if(request.get == "일본어"){ 36 + else if(question == "일본어"){
36 transja(eventObj.replyToken, eventObj.message.text); 37 transja(eventObj.replyToken, eventObj.message.text);
37 } 38 }
38 39
......