박찬수

reply.js modified.

Showing 1 changed file with 4 additions and 27 deletions
...@@ -9,13 +9,14 @@ const HTTPS = require('https'); ...@@ -9,13 +9,14 @@ const HTTPS = require('https');
9 const domain = "2018102191.osschatbot2022.tk" 9 const domain = "2018102191.osschatbot2022.tk"
10 const sslport = 23023; 10 const sslport = 23023;
11 11
12 -var soccer = require('./soccer.js'); 12 +var data = require('./getid.js');
13 13
14 const bodyParser = require('body-parser'); 14 const bodyParser = require('body-parser');
15 -const { EventEmitter } = require('stream'); 15 +
16 +data.SetData();
17 +
16 var app = express(); 18 var app = express();
17 app.use(bodyParser.json()); 19 app.use(bodyParser.json());
18 -
19 app.post('/hook', function (req, res) { 20 app.post('/hook', function (req, res) {
20 21
21 var eventObj = req.body.events[0]; 22 var eventObj = req.body.events[0];
...@@ -30,31 +31,7 @@ app.post('/hook', function (req, res) { ...@@ -30,31 +31,7 @@ app.post('/hook', function (req, res) {
30 console.log("Receive Message : ", eventObj.message.text); 31 console.log("Receive Message : ", eventObj.message.text);
31 32
32 GetPlayerInfo(276, 2019, eventObj); 33 GetPlayerInfo(276, 2019, eventObj);
33 -
34 - // request.post(
35 - // {
36 - // url: TARGET_URL,
37 - // headers: {
38 - // 'Authorization': `Bearer ${TOKEN}` // 인증정보 : channel token 값을 통해 인증.
39 - // },
40 - // json: {
41 - // "replyToken":eventObj.replyToken, // reply token : 누구한테 보낼 것인지?를 판별하기 위해!
42 - // "messages":[
43 - // {
44 - // "type":"text",
45 - // "text":"Hello, user"
46 - // },
47 - // {
48 - // "type":"text",
49 - // "text":"May I help you?"
50 - // }
51 - // ]
52 - // }
53 - // },(error, response, body) => {
54 - // console.log(body);
55 - // });
56 34
57 -
58 res.sendStatus(200); 35 res.sendStatus(200);
59 }); 36 });
60 37
......