최한솔

webhook plus

Showing 1 changed file with 8 additions and 8 deletions
...@@ -16,7 +16,7 @@ const client = new line.Client(config); ...@@ -16,7 +16,7 @@ const client = new line.Client(config);
16 16
17 // register a webhook handler with middleware 17 // register a webhook handler with middleware
18 // about the middleware, please refer to doc 18 // about the middleware, please refer to doc
19 -app.post('/webhook', line.middleware(config), (req, res) => { 19 +app.post('https://bots.dialogflow.com/line/d1584d25-0e52-48da-b6cc-20e021dc5e70/webhook', line.middleware(config), (req, res) => {
20 Promise 20 Promise
21 .all(req.body.events.map(handleEvent)) 21 .all(req.body.events.map(handleEvent))
22 .then((result) => res.json(result)) 22 .then((result) => res.json(result))
...@@ -63,13 +63,13 @@ function handleEvent(event) { ...@@ -63,13 +63,13 @@ function handleEvent(event) {
63 if (dateObj.getHours() > 12) { 63 if (dateObj.getHours() > 12) {
64 formatted = dateObj.getHours() - 12; 64 formatted = dateObj.getHours() - 12;
65 pm = true; 65 pm = true;
66 - } 66 + }
67 else if (dateObj.getHours() < 12 && dateObj.getHours() != 0) { 67 else if (dateObj.getHours() < 12 && dateObj.getHours() != 0) {
68 formatted = dateObj.getHours(); 68 formatted = dateObj.getHours();
69 - } 69 + }
70 else if (dateObj.getHours() == 0) { 70 else if (dateObj.getHours() == 0) {
71 formatted = "12"; 71 formatted = "12";
72 - } 72 + }
73 else if (dateObj.getHours() == 12) { 73 else if (dateObj.getHours() == 12) {
74 formatted = "12"; 74 formatted = "12";
75 pm = true; 75 pm = true;
...@@ -77,14 +77,14 @@ function handleEvent(event) { ...@@ -77,14 +77,14 @@ function handleEvent(event) {
77 77
78 if (dateObj.getMinutes() < 10) { 78 if (dateObj.getMinutes() < 10) {
79 formatted = formatted + ":0" + dateObj.getMinutes(); 79 formatted = formatted + ":0" + dateObj.getMinutes();
80 - } 80 + }
81 else { 81 else {
82 formatted = formatted + ":" + dateObj.getMinutes(); 82 formatted = formatted + ":" + dateObj.getMinutes();
83 } 83 }
84 84
85 if (pm == true) { 85 if (pm == true) {
86 formatted = formatted + " PM"; 86 formatted = formatted + " PM";
87 - } 87 + }
88 else { 88 else {
89 formatted = formatted + " AM"; 89 formatted = formatted + " AM";
90 } 90 }
...@@ -151,7 +151,7 @@ function sleep(ghour, gmin, ampm) { ...@@ -151,7 +151,7 @@ function sleep(ghour, gmin, ampm) {
151 console.log(String(retDate(res4))); 151 console.log(String(retDate(res4)));
152 console.log(String(retDate(res5))); 152 console.log(String(retDate(res5)));
153 console.log(String(retDate(res6))); 153 console.log(String(retDate(res6)));
154 - 154 +
155 $('#resultsNow').fadeIn(); 155 $('#resultsNow').fadeIn();
156 $('#feedback').fadeIn(); 156 $('#feedback').fadeIn();
157 $('#ad').fadeIn(); 157 $('#ad').fadeIn();
...@@ -215,7 +215,7 @@ function sleep(ghour, gmin, ampm) { ...@@ -215,7 +215,7 @@ function sleep(ghour, gmin, ampm) {
215 215
216 }); 216 });
217 */ 217 */
218 - 218 +
219 219
220 app.listen(3000, function () { 220 app.listen(3000, function () {
221 console.log('Linebot listening on port 3000!'); 221 console.log('Linebot listening on port 3000!');
......