권은령

update app.js

...@@ -120,7 +120,7 @@ function handleEvent(event) ...@@ -120,7 +120,7 @@ function handleEvent(event)
120 // ignore non-text-message event 120 // ignore non-text-message event
121 return Promise.resolve(null); 121 return Promise.resolve(null);
122 } 122 }
123 - else if(event.message.text.substring(0, 5)=='순위 보기') 123 + else if(event.message.text.substring(0, 5)=='차트 보기')
124 { 124 {
125 // music list 출력 125 // music list 출력
126 var url="https://www.genie.co.kr/chart/top200"; 126 var url="https://www.genie.co.kr/chart/top200";
...@@ -160,8 +160,16 @@ function handleEvent(event) ...@@ -160,8 +160,16 @@ function handleEvent(event)
160 } 160 }
161 else if(event.message.text.substring(0, 5)=='가사 검색') 161 else if(event.message.text.substring(0, 5)=='가사 검색')
162 { 162 {
163 + /*
164 + if(songList[0]==undefined)
165 + {
166 + var result = { type: 'text', text:''};
167 + result.text=""
168 + client.replyMessage(event.replyToken, result);
169 + }
170 + */
163 var userNum=event.message.text[6] 171 var userNum=event.message.text[6]
164 - var newUrl=songList[userNum].url; 172 + var newUrl=songList[userNum-1].url;
165 var lyric=''; 173 var lyric='';
166 174
167 request(newUrl, function(error, response, html) 175 request(newUrl, function(error, response, html)
......
...@@ -57,4 +57,10 @@ request(url, function(error, response, html) ...@@ -57,4 +57,10 @@ request(url, function(error, response, html)
57 console.log(songList[randnum].song); 57 console.log(songList[randnum].song);
58 console.log(lyric); 58 console.log(lyric);
59 }); 59 });
60 -})
...\ No newline at end of file ...\ No newline at end of file
60 +})
61 +
62 +if(songList[0]==undefined)
63 +{
64 + console.log("hhh");
65 +}
66 +console.log(songList[0]);
...\ No newline at end of file ...\ No newline at end of file
......