Showing
1 changed file
with
3 additions
and
5 deletions
... | @@ -13,7 +13,7 @@ const sslport = 23023; | ... | @@ -13,7 +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 | + |
17 | var cmd = ""; | 17 | var cmd = ""; |
18 | app.post('/hook', function (req, res) { | 18 | app.post('/hook', function (req, res) { |
19 | 19 | ||
... | @@ -27,11 +27,11 @@ app.post('/hook', function (req, res) { | ... | @@ -27,11 +27,11 @@ app.post('/hook', function (req, res) { |
27 | console.log('[request source] ', eventObj.source); | 27 | console.log('[request source] ', eventObj.source); |
28 | console.log('[request message]', eventObj.message); | 28 | console.log('[request message]', eventObj.message); |
29 | 29 | ||
30 | - cmd = message.text; | 30 | + cmd = eventObj.message.text; |
31 | 31 | ||
32 | res.sendStatus(200); | 32 | res.sendStatus(200); |
33 | }); | 33 | }); |
34 | -*/ | 34 | + |
35 | app.post('/hook', function (req, res) { | 35 | app.post('/hook', function (req, res) { |
36 | 36 | ||
37 | var eventObj = req.body.events[0]; | 37 | var eventObj = req.body.events[0]; |
... | @@ -43,8 +43,6 @@ app.post('/hook', function (req, res) { | ... | @@ -43,8 +43,6 @@ app.post('/hook', function (req, res) { |
43 | console.log('[request]', req.body); | 43 | console.log('[request]', req.body); |
44 | console.log('[request source] ', eventObj.source); | 44 | console.log('[request source] ', eventObj.source); |
45 | console.log('[request message]', eventObj.message); | 45 | console.log('[request message]', eventObj.message); |
46 | - | ||
47 | - var cmd = message.text; | ||
48 | 46 | ||
49 | if(cmd == "영어"){ | 47 | if(cmd == "영어"){ |
50 | trans(eventObj.replyToken, eventObj.message.text); | 48 | trans(eventObj.replyToken, eventObj.message.text); | ... | ... |
-
Please register or login to post a comment