root

update app.js

Showing 1 changed file with 36 additions and 5 deletions
...@@ -48,11 +48,38 @@ function find_current(eventObj,res){ //Two ...@@ -48,11 +48,38 @@ function find_current(eventObj,res){ //Two
48 json: { 48 json: {
49 "replyToken":eventObj.replyToken, //eventObj.replyToken 49 "replyToken":eventObj.replyToken, //eventObj.replyToken
50 "messages":[ 50 "messages":[
51 - { 51 + {
52 - "type": "text", // ① 52 + "type": "location",
53 - "text": "응급 상황인가요?"}, 53 + "title": "현재위치",
54 - {"type": "text", 54 + "address": "경기 안산시 단원구 석수동길",
55 - "text": "현재있는 위치의 주소나 보이는 곳을 입력하세요."}, 55 + "latitude": 37.3446767467006,
56 + "longitude": 126.807581282114
57 + },
58 + {
59 + "type": "template",
60 + "altText": "This is a buttons template",
61 + "template": {
62 + "type": "buttons",
63 + "text": "이곳이 맞나요?",
64 + "defaultAction": {
65 + "type": "uri",
66 + "label": "View detail",
67 + "uri": "http://example.com/page/123"
68 + },
69 + "actions": [
70 + {
71 + "type": "postback",
72 + "label": "네",
73 + "data": "action=buy&itemid=123"
74 + },
75 + {
76 + "type": "postback",
77 + "label": "아니요",
78 + "data": "action=add&itemid=123"
79 + },
80 + ]
81 + }
82 + }
56 83
57 84
58 ], 85 ],
...@@ -76,6 +103,10 @@ app.post('/hook', function (req, res) { ...@@ -76,6 +103,10 @@ app.post('/hook', function (req, res) {
76 } 103 }
77 else if (event_time ==2){ 104 else if (event_time ==2){
78 find_current(eventObj,res) 105 find_current(eventObj,res)
106 + event_time =3
107 + }
108 + else if (event_time ==3){
109 +
79 } 110 }
80 111
81 }); 112 });
......