윤동주

heroku added app.js

Showing 1 changed file with 6 additions and 3 deletions
...@@ -16,11 +16,11 @@ const client = new line.Client(config); ...@@ -16,11 +16,11 @@ 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('https://bots.dialogflow.com/line/d1584d25-0e52-48da-b6cc-20e021dc5e70/webhook', line.middleware(config), (req, res) => { 19 +app.post('https://mylinebottest1.herokuapp.com/callback', 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))
23 - .catch((err) => { 23 + .catch((err) => { //error handling
24 console.error(err); 24 console.error(err);
25 res.status(200).end(); 25 res.status(200).end();
26 }); 26 });
...@@ -36,7 +36,7 @@ function handleEvent(event) { ...@@ -36,7 +36,7 @@ function handleEvent(event) {
36 //내가 짠 것 36 //내가 짠 것
37 function getup(shour, smin, ampm) {//몇시에 자려고 할 때 언제 일어나면 좋을지 37 function getup(shour, smin, ampm) {//몇시에 자려고 할 때 언제 일어나면 좋을지
38 if (shour != '(hour)' && smin != '(minute)') { 38 if (shour != '(hour)' && smin != '(minute)') {
39 - ; //탈출 39 + //; //탈출
40 var setTime = new Date(); 40 var setTime = new Date();
41 41
42 if (shour == 12) { 42 if (shour == 12) {
...@@ -156,6 +156,7 @@ function sleep(ghour, gmin, ampm) { //ëª‡ì‹œì— ì¼ì–´ë‚˜ë ¤ê³  í•  때 언제 ì ...@@ -156,6 +156,7 @@ function sleep(ghour, gmin, ampm) { //ëª‡ì‹œì— ì¼ì–´ë‚˜ë ¤ê³  í•  때 언제 ì
156 $('#feedback').fadeIn(); 156 $('#feedback').fadeIn();
157 $('#ad').fadeIn(); 157 $('#ad').fadeIn();
158 }; 158 };
159 +/*
159 //sleep 함수 160 //sleep 함수
160 console.log("You should try to fall asleep at one of the following times: "); 161 console.log("You should try to fall asleep at one of the following times: ");
161 "sres1" title="Six Cycles: Nine Hours of Sleep" 162 "sres1" title="Six Cycles: Nine Hours of Sleep"
...@@ -192,6 +193,8 @@ console.log("The average human takes fourteen minutes to fall asleep, so plan ac ...@@ -192,6 +193,8 @@ console.log("The average human takes fourteen minutes to fall asleep, so plan ac
192 console.log("꿀잠봇 works by counting backwards in sleep cycles."); 193 console.log("꿀잠봇 works by counting backwards in sleep cycles.");
193 console.log("Waking up in the middle of a sleep cycle leaves you feeling tired and groggy, but waking up in between cycles wakes you up feeling refreshed and alert!"); 194 console.log("Waking up in the middle of a sleep cycle leaves you feeling tired and groggy, but waking up in between cycles wakes you up feeling refreshed and alert!");
194 console.log("A good night's sleep consists of 5-6 complete sleep cycles."); 195 console.log("A good night's sleep consists of 5-6 complete sleep cycles.");
196 +*/
197 +
195 /* 198 /*
196 //언어 감지 option 199 //언어 감지 option
197 var detect_options = { 200 var detect_options = {
......