김대욱

wish2

Showing 1 changed file with 6 additions and 5 deletions
...@@ -24,16 +24,17 @@ app.post('/hook', function (req, res) { ...@@ -24,16 +24,17 @@ app.post('/hook', function (req, res) {
24 console.log('[request]', req.body); 24 console.log('[request]', req.body);
25 console.log('[request source] ', eventObj.source); 25 console.log('[request source] ', eventObj.source);
26 console.log('[request message]', eventObj.message); 26 console.log('[request message]', eventObj.message);
27 +
28 + var cmd = message.text;
29 + console.log('[command]',cmd);
27 30
28 - const question = req.body.userRequest.utterance; 31 + if(cmd == "영어"){
29 -
30 - if(question == "영어"){
31 transen(eventObj.replyToken, eventObj.message.text); 32 transen(eventObj.replyToken, eventObj.message.text);
32 } 33 }
33 - else if(question == "프랑스어"){ 34 + else if(cmd == "프랑스어"){
34 transfr(eventObj.replyToken, eventObj.message.text); 35 transfr(eventObj.replyToken, eventObj.message.text);
35 } 36 }
36 - else if(question == "일본어"){ 37 + else if(cmd == "일본어"){
37 transja(eventObj.replyToken, eventObj.message.text); 38 transja(eventObj.replyToken, eventObj.message.text);
38 } 39 }
39 40
......