我透過這網站架成line bot來接收表單
https://sites.google.com/jes.mlc.edu.tw/ljj/linebot%E5%AF%A6%E5%81%9A/%E5%A6%82%E4%BD%95%E7%94%A8linebot%E5%8F%96%E4%BB%A3google%E8%A1%A8%E5%96%AE
目前只能接收文字的回饋,但是沒辦法接收位置的訊息
//LineBot收到user的文字訊息時的處理函式
bot.on('message', function(event) {
if (event.message.type === 'text') {
var myId=event.source.userId;
if (users[myId]==undefined){
users[myId]=[];
users[myId].userId=myId;
users[myId].step=-1;
users[myId].replies=[];
}
var myStep=users[myId].step;
if (myStep===-1)
sendMessage(event,myQuestions[0][0]);
else{
if (myStep==(totalSteps-1))
sendMessage(event,myQuestions[1][myStep]);
else
sendMessage(event,myQuestions[1][myStep]+'\n'+myQuestions[0][myStep+1]);
users[myId].replies[myStep+1]=event.message.text;
}
myStep++;
users[myId].step=myStep;
if (myStep>=totalSteps){
myStep=-1;
users[myId].step=myStep;
users[myId].replies[0]=new Date();
appendMyRow(myId);
}
}
});