김대욱

제발15

Showing 1 changed file with 34 additions and 3 deletions
...@@ -48,13 +48,44 @@ app.post('/hook', function (req, res) { ...@@ -48,13 +48,44 @@ app.post('/hook', function (req, res) {
48 var cmd = eventObj.message.text; 48 var cmd = eventObj.message.text;
49 49
50 if(cmd == "영어"){ 50 if(cmd == "영어"){
51 - transen(eventObj.replyToken, eventObj.message.text); 51 + app.post('/hook', function (req, res) {
52 +
53 + var eventObj = req.body.events[0];
54 + var source = eventObj.source;
55 + var message = eventObj.message;
56 +
57 + transen(eventObj.replyToken, eventObj.message.text);
58 +
59 +
60 + res.sendStatus(200);
61 + });
62 +
52 } 63 }
53 else if(cmd == "프랑스어"){ 64 else if(cmd == "프랑스어"){
54 - transfr(eventObj.replyToken, eventObj.message.text); 65 + app.post('/hook', function (req, res) {
66 +
67 + var eventObj = req.body.events[0];
68 + var source = eventObj.source;
69 + var message = eventObj.message;
70 +
71 + transfr(eventObj.replyToken, eventObj.message.text);
72 +
73 +
74 + res.sendStatus(200);
75 + });
55 } 76 }
56 else if(cmd == "일본어"){ 77 else if(cmd == "일본어"){
57 - transja(eventObj.replyToken, eventObj.message.text); 78 + app.post('/hook', function (req, res) {
79 +
80 + var eventObj = req.body.events[0];
81 + var source = eventObj.source;
82 + var message = eventObj.message;
83 +
84 + transja(eventObj.replyToken, eventObj.message.text);
85 +
86 +
87 + res.sendStatus(200);
88 + });
58 } 89 }
59 90
60 res.sendStatus(200); 91 res.sendStatus(200);
......