Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -13,6 +13,7 @@ const sslport = 23023; | ... | @@ -13,6 +13,7 @@ const sslport = 23023; |
13 | const bodyParser = require('body-parser'); | 13 | const bodyParser = require('body-parser'); |
14 | var app = express(); | 14 | var app = express(); |
15 | app.use(bodyParser.json()); | 15 | app.use(bodyParser.json()); |
16 | +/* | ||
16 | var cmd = ""; | 17 | var cmd = ""; |
17 | app.post('/hook', function (req, res) { | 18 | app.post('/hook', function (req, res) { |
18 | 19 | ||
... | @@ -30,6 +31,7 @@ app.post('/hook', function (req, res) { | ... | @@ -30,6 +31,7 @@ app.post('/hook', function (req, res) { |
30 | 31 | ||
31 | res.sendStatus(200); | 32 | res.sendStatus(200); |
32 | }); | 33 | }); |
34 | +*/ | ||
33 | app.post('/hook', function (req, res) { | 35 | app.post('/hook', function (req, res) { |
34 | 36 | ||
35 | var eventObj = req.body.events[0]; | 37 | var eventObj = req.body.events[0]; |
... | @@ -42,6 +44,8 @@ app.post('/hook', function (req, res) { | ... | @@ -42,6 +44,8 @@ app.post('/hook', function (req, res) { |
42 | console.log('[request source] ', eventObj.source); | 44 | console.log('[request source] ', eventObj.source); |
43 | console.log('[request message]', eventObj.message); | 45 | console.log('[request message]', eventObj.message); |
44 | 46 | ||
47 | + var cmd = message.text; | ||
48 | + | ||
45 | if(cmd == "영어"){ | 49 | if(cmd == "영어"){ |
46 | trans(eventObj.replyToken, eventObj.message.text); | 50 | trans(eventObj.replyToken, eventObj.message.text); |
47 | } | 51 | } | ... | ... |
-
Please register or login to post a comment