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