Showing
2 changed files
with
24 additions
and
2 deletions
This diff is collapsed. Click to expand it.
| ... | @@ -20,11 +20,33 @@ app.post('/hook', function (req, res) { | ... | @@ -20,11 +20,33 @@ app.post('/hook', function (req, res) { |
| 20 | 20 | ||
| 21 | // request log | 21 | // request log |
| 22 | console.log('======================', new Date(), '======================'); | 22 | console.log('======================', new Date(), '======================'); |
| 23 | + console.log(eventObj); | ||
| 24 | + if (eventObj.type=="message") // 일반 메시지일때 | ||
| 25 | + react(eventObj.replyToken, message.text,eventObj.source.userId); | ||
| 26 | + else if (eventObj.postback.data=="썸네일") //설정에서 썸네일 설정버튼을 눌렀을때 | ||
| 27 | + songs.thumbnail_settings(eventObj.replyToken,eventObj.source.userId); | ||
| 28 | + | ||
| 29 | + //else if (썸네일 설정 버튼을 누르고 거기서 응답이 들어왔을때) | ||
| 30 | + | ||
| 31 | + else if (eeventObj.postback.data=="개수") //설정에서 출력 개수 설정버튼을 눌렀을때 | ||
| 32 | + songs.amount_settings(eventObj.replyToken,eventObj.source.userId); | ||
| 33 | + | ||
| 34 | + //else if (출력 개수 설정 버튼을 누르고 거기서 응답이 들어왔을때) | ||
| 35 | + | ||
| 36 | + else if (eventObj.postback.data=="주소") //설정에서 유튜브 주소 설정버튼을 눌렀을때 | ||
| 37 | + songs.address_settings(eventObj.replyToken,eventObj.source.userId); | ||
| 38 | + | ||
| 39 | + //else if (유튜브 주소 설정 버튼을 누르고 거기서 응답이 들어왔을때) | ||
| 40 | + | ||
| 41 | + //★★else if (플레이리스트를 입력했을때 뜬 버튼에서 장르를 눌렀을때) | ||
| 42 | + | ||
| 43 | + //★★else if (플레이리스트를 입력했을때 뜬 버튼에서 무드를 눌렀을때) | ||
| 44 | + | ||
| 45 | + //★★else if (플레이리스트를 입력했을때 뜬 버튼에서 가수를 눌렀을때) | ||
| 23 | 46 | ||
| 24 | - send(eventObj.replyToken, message.text,eventObj.source.userId); | ||
| 25 | res.sendStatus(200); | 47 | res.sendStatus(200); |
| 26 | }); | 48 | }); |
| 27 | -function send(replyToken, message,userId) { | 49 | +function react(replyToken, message,userId) { |
| 28 | 50 | ||
| 29 | request.post( | 51 | request.post( |
| 30 | { | 52 | { | ... | ... |
-
Please register or login to post a comment