More actions
No edit summary |
No edit summary |
||
Line 71: | Line 71: | ||
Click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Log in with LINE account.</span></span>'''<br /> | Click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Log in with LINE account.</span></span>'''<br /> | ||
Click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Create.</span></span>'''''''''<br /> | Click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Create.</span></span>'''''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/43147207b4eb4e1684a075e305cb67a2.png<br /> | |||
''''''Type your name and click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Create.</span></span>'''''''''<br /> | ''''''Type your name and click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Create.</span></span>'''''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/9cc90ea609fef8352e3bca436c3dfadb.png<br /> | |||
''''''Click '''<span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">Create a Messaging API channel</span>.</span>'''''''''<br /> | ''''''Click '''<span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">Create a Messaging API channel</span>.</span>'''''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/2394c4de74d3c34c186f373a02b3f2f6.png<br /> | |||
'''<br /> | '''<br /> | ||
'''Type each item and click <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">'''Create.'''</span></span>''''''<br /> | '''Type each item and click <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">'''Create.'''</span></span>''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/e611043d9c7da0be833f17bd36e62bc5.png<br /> | |||
''''''Click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Messaging API.</span></span>''''''<br /> | ''''''Click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Messaging API.</span></span>''''''<br /> | ||
'''<br /> | '''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/73774f8d71e0ca5756e72fda20f94ebd.png<br /> | |||
'''<br /> | '''<br /> | ||
'''Find '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Channel access token (long-lived)</span></span>''' and click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Issue.</span></span>'''<br /> | '''Find '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Channel access token (long-lived)</span></span>''' and click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Issue.</span></span>'''<br /> | ||
Then copy '''<span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">Channel access token (long-lived).</span></span>'''''''''<br /> | Then copy '''<span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">Channel access token (long-lived).</span></span>'''''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/15ffd7c288cbf6ab5144158f5402e3a5.png<br /> | |||
'''<br /> | '''<br /> | ||
Please access this site.<br /> | Please access this site.<br /> | ||
Line 91: | Line 91: | ||
Click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Go to google drive</span></span>''' and '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">login.</span></span>'''<br /> | Click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Go to google drive</span></span>''' and '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">login.</span></span>'''<br /> | ||
Click '''<span style="font-size: 15px"><span style="color: rgb(77, 77, 255)">New </span></span>'''and click'''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)"> Google sheets(1 time) </span></span>'''and click <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">'''More''' </span><span style="color: rgb(0, 0, 0)">'''->'''</span><span style="color: rgb(0, 0, 255)"> '''Google apps script (1 time).'''</span></span>''''''<br /> | Click '''<span style="font-size: 15px"><span style="color: rgb(77, 77, 255)">New </span></span>'''and click'''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)"> Google sheets(1 time) </span></span>'''and click <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">'''More''' </span><span style="color: rgb(0, 0, 0)">'''->'''</span><span style="color: rgb(0, 0, 255)"> '''Google apps script (1 time).'''</span></span>''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/5a603a93e5c14227b22e3bd661c43016.png<br /> | |||
'''<br /> | '''<br /> | ||
<br /> | <br /> | ||
'''Open created <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">'''Google sheets''' </span><span style="color: rgb(64, 64, 64)">and copy</span> <span style="color: rgb(0, 0, 255)">'''sheet id.(Do''' </span><span style="color: rgb(255, 0, 0)">'''NOT''' </span><span style="color: rgb(0, 0, 255)">'''include ''''</span><span style="color: rgb(255, 0, 0)">'''/'''</span><span style="color: rgb(0, 0, 255)">'''' )'''</span></span>''''''<br /> | '''Open created <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">'''Google sheets''' </span><span style="color: rgb(64, 64, 64)">and copy</span> <span style="color: rgb(0, 0, 255)">'''sheet id.(Do''' </span><span style="color: rgb(255, 0, 0)">'''NOT''' </span><span style="color: rgb(0, 0, 255)">'''include ''''</span><span style="color: rgb(255, 0, 0)">'''/'''</span><span style="color: rgb(0, 0, 255)">'''' )'''</span></span>''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/f22b2c7b64acf04808a118983f744685.png<br /> | |||
''''''<span style="color: rgb(0, 0, 255)"><br /> | ''''''<span style="color: rgb(0, 0, 255)"><br /> | ||
</span>'''<br /> | </span>'''<br /> | ||
Open created '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Google apps script </span></span>'''and Insert name.("Line main" in this guide)'''<br /> | Open created '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Google apps script </span></span>'''and Insert name.("Line main" in this guide)'''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/cf714d96090d736cb42a24b7a8997deb.png<br /> | |||
'''<br /> | '''<br /> | ||
'''Copy this code to "<span style="font-size: 15px">Line main</span>" and add your <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">sheet ID, </span></span>'''<span style="font-size: 15px">'''<span style="color: rgb(0, 0, 255)">access token</span>''' and '''<span style="color: rgb(0, 0, 255)"> 3DS's account name</span>(Your favorite name).'''</span><br /> | '''Copy this code to "<span style="font-size: 15px">Line main</span>" and add your <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">sheet ID, </span></span>'''<span style="font-size: 15px">'''<span style="color: rgb(0, 0, 255)">access token</span>''' and '''<span style="color: rgb(0, 0, 255)"> 3DS's account name</span>(Your favorite name).'''</span><br /> | ||
Line 544: | Line 544: | ||
'''Next click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Review permissions </span></span>'''and select your google account.<br /> | '''Next click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Review permissions </span></span>'''and select your google account.<br /> | ||
'''If "'''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">This app isn't verified </span></span><span style="font-size: 12px">or </span><span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">You should avoid this app</span></span>'''" shown click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Advanced </span></span>'''and click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Go to Line main (unsafe) </span></span>'''and click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">allow.</span></span>''''''<br /> | '''If "'''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">This app isn't verified </span></span><span style="font-size: 12px">or </span><span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">You should avoid this app</span></span>'''" shown click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Advanced </span></span>'''and click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Go to Line main (unsafe) </span></span>'''and click '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">allow.</span></span>''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/2380c28d8c9f5f0fdba5bcaad06b5e09.png<br /> | |||
'''Copy <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">'''this url''' </span></span>and<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)"> '''save.'''</span></span>''''''<br /> | '''Copy <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">'''this url''' </span></span>and<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)"> '''save.'''</span></span>''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/578f8adc76932a8223d45d904303d707.png<br /> | |||
'''<br /> | '''<br /> | ||
''''''Back to <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Line Messaging API</span></span><br /> | ''''''Back to <span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Line Messaging API</span></span><br /> | ||
Find '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Webhook URL </span></span>'''and click '''<span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">edit.</span></span>'''''''''<br /> | Find '''<span style="font-size: 15px"><span style="color: rgb(0, 0, 255)">Webhook URL </span></span>'''and click '''<span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">edit.</span></span>'''''''''<br /> | ||
<span style="color: rgb(64, 64, 64)"><span style="font-size: 15px">Type your</span></span><span style="color: rgb(0, 0, 255)"><span style="font-size: 15px"> '''URL''' </span></span><span style="color: rgb(64, 64, 64)"><span style="font-size: 15px">and click </span></span><span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">'''Update'''</span></span>'''<br /> | <span style="color: rgb(64, 64, 64)"><span style="font-size: 15px">Type your</span></span><span style="color: rgb(0, 0, 255)"><span style="font-size: 15px"> '''URL''' </span></span><span style="color: rgb(64, 64, 64)"><span style="font-size: 15px">and click </span></span><span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">'''Update'''</span></span>'''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/003b8ec8407b4db43fef03a9a6337a6b.png<br /> | |||
''''''<span style="color: rgb(64, 64, 64)"><span style="font-size: 15px">And turn on </span></span><span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">'''Use webhook'''</span></span>''''''<br /> | ''''''<span style="color: rgb(64, 64, 64)"><span style="font-size: 15px">And turn on </span></span><span style="color: rgb(0, 0, 255)"><span style="font-size: 15px">'''Use webhook'''</span></span>''''''<br /> | ||
https://dlhb.gamebrew.org/3dshomebrew/5dc4172fb531eacaf26757aa3fdb1b64.png |
Revision as of 13:42, 15 April 2020
Line for 3DS
Official Discord
Index
Patch note
V1.3.1
- 【App】 Ver 1.3.1
- 【Line】 Fixed- Common occurring [FSUSER_OpenArchive failed] error has been solved.
- 【Line】 Fixed- Image display now activated by touching the message.
- 【Setting】 Fixed- Setting menu framerate now improved.
- 【Image viewer】 Fixed- Image display speed now improved.
v1.2.0
- Fix- Some crashes
- Fix- Some settings do not work
- Fix- Log download (GAS processing) speed has been improved(GAS update required)
- Add- Image viewer
Summary
Video
- Send text ?
- Send picture ?
- Send video ?
- Send sound ?
- Send stamp ?
- Receive text ?
- Receive (View) picture ? (v1.2.0)
- Receive (Play) video ?
- Receive (Play) sound ?
- Receive (View) stamp ?
- View old log ? (Until max 300 logs)
- Auto update ? (v0.2.0)
- Group chat ?
- Night mode ? (v0.2.0)
- Password ? (v0.3.0)
- Save log to SD card ? (v0.3.0)
How to use
How to install and use for version 1.3.0~
Please access this site.
https://developers.line.biz/en/
Click log in.
Click Log in with LINE account.
Click Create.''''
'Type your name and click Create.''''
'Click Create a Messaging API channel.''''
Type each item and click Create.'
'Click Messaging API.'
Find Channel access token (long-lived) and click Issue.
Then copy Channel access token (long-lived).''''
Please access this site.
https://www.google.com/intl/en_ALL/drive/
Click Go to google drive and login.
Click New 'and click Google sheets(1 time) and click More -> Google apps script (1 time).'
Open created Google sheets and copy sheet id.(Do NOT include '/' )'
'
Open created Google apps script and Insert name.("Line main" in this guide)
Copy this code to "Line main" and add your sheet ID, access token and 3DS's account name(Your favorite name).
Code: </div> <pre>var ACCESS_TOKEN = "Your acces token here"; var open_sheet_id = "Your sheet id here"; var account_name_of_3ds = "Your 3ds's account name here"; var script_password = "Your google apps script password here"; var gas_ver = 3;//Do **NOT** edit this value. function log_save(message, user_name, write_sheet_name) { var sheet_pos = 1; var spreadsheet = SpreadsheetApp.openById(open_sheet_id); var write_sheet = spreadsheet.getSheetByName(write_sheet_name); if(!write_sheet) { spreadsheet.insertSheet(write_sheet_name); write_sheet = spreadsheet.getSheetByName(write_sheet_name); } sheet_pos = get_cache_pos(write_sheet); while(true) { var sheet_data = write_sheet.getRange("A" + sheet_pos).getValue(); if(sheet_data == "") { write_sheet.getRange("A" + sheet_pos).setValue("" + user_name + " : " + message); break; } else sheet_pos++; } write_cache_pos(write_sheet, (sheet_pos + 1)); } function log_read(id) { var sheet_start = 1; var return_data; var sheet_data; var spreadsheet = SpreadsheetApp.openById(open_sheet_id); var read_sheet = spreadsheet.getSheetByName(id); sheet_start = get_cache_pos(read_sheet); while(true) { sheet_data = read_sheet.getRange("A" + sheet_start).getValue(); if(sheet_data == "") { write_cache_pos(read_sheet, sheet_start); if(sheet_start >= 301) sheet_start = (sheet_start - 300); else sheet_start = 1; break; } else sheet_start++; } sheet_data = read_sheet.getRange(sheet_start, 1, 300).getValues(); for(var i = 0; i < 300; i++) { if(sheet_data[i] == "") break; return_data += sheet_data[i]; } return return_data; } function get_cache_pos(sheet_object) { var cached_sheet_pos = sheet_object.getRange("B1").getValue(); var sheet_data; if(parseInt(cached_sheet_pos) > 0) { cached_sheet_pos = parseInt(cached_sheet_pos); sheet_data = sheet_object.getRange("A" + (cached_sheet_pos - 1)).getValue(); if(sheet_data != "") return cached_sheet_pos; } return 1; } function write_cache_pos(sheet_object, cache_data) { sheet_object.getRange("B1").setValue(cache_data); } function send_msg(id, send_message, time) { var return_message = "Success"; var response; var url = 'https://api.line.me/v2/bot/message/push'; response = UrlFetchApp.fetch(url, { 'headers': { 'Content-Type': 'application/json; charset=UTF-8', 'Authorization': 'Bearer ' + ACCESS_TOKEN, }, 'method': 'post', 'payload': JSON.stringify({ "to": id, "messages": [ { "text": send_message, "type": "text", }], 'notificationDisabled': 'false', }), muteHttpExceptions: true, }); if(response.getResponseCode() != 200) { var cache = "***Send failed. Status code = " + response.getResponseCode() + "\n" + JSON.parse(response.getContentText()).message + "*** "; cache += send_message; send_message = cache; return_message = "Send message failed. Status code = " + response.getResponseCode() + "\n" + JSON.parse(response.getContentText()).message; } send_message += "(" + time + ")"; log_save(send_message, account_name_of_3ds, id); return return_message; } function send_sticker(id, package_id, sticker_id, time) { var return_message = "Success"; var send_message = ""; var response; var url = 'https://api.line.me/v2/bot/message/push'; response = UrlFetchApp.fetch(url, { 'headers': { 'Content-Type': 'application/json; charset=UTF-8', 'Authorization': 'Bearer ' + ACCESS_TOKEN, }, 'method': 'post', 'payload': JSON.stringify({ "to": id, "messages": [ { "type": "sticker", "packageId": package_id, "stickerId": sticker_id, }], 'notificationDisabled': 'false', }), muteHttpExceptions: true, }); if(response.getResponseCode() != 200) { send_message = "***Send failed. Status code = " + response.getResponseCode() + "\n" + JSON.parse(response.getContentText()).message + "*** "; return_message = "Send sticker failed. Status code = " + response.getResponseCode() + "\n" + JSON.parse(response.getContentText()).message; } send_message += "<sticker>" + sticker_id + "</sticker>(" + time + ")"; log_save(send_message, account_name_of_3ds, id); return return_message; } function get_content_url(request_id, group_or_user_id, type) { var content_url = "https://api.line.me/v2/bot/message/" + request_id + "/content"; var url = ""; var folder_name; var folder; var sub_folder; var folder_exist = false; var sub_folder_exist = false; try { if(type == "image") folder_name = "Line_images"; else if(type == "audio") folder_name = "Line_audio"; else if(type == "video") folder_name = "Line_videos"; var exist_folders = DriveApp.searchFolders("'me' in owners"); while (exist_folders.hasNext()) { folder = exist_folders.next(); if(folder_name == folder.getName()) { folder_exist = true; break; } } if(!folder_exist) folder = DriveApp.createFolder(folder_name); var exist_sub_folders = folder.searchFolders("'me' in owners"); while (exist_sub_folders.hasNext()) { sub_folder = exist_sub_folders.next(); if(group_or_user_id == sub_folder.getName()) { sub_folder_exist = true; break; } } if(!sub_folder_exist) sub_folder = folder.createFolder(group_or_user_id); var response = UrlFetchApp.fetch(content_url, { 'headers': { 'Content-Type': 'application/json; charset=UTF-8', 'Authorization': 'Bearer ' + ACCESS_TOKEN, } }); if(type == "image") { var image_data = response.getBlob().getAs("image/jpeg").setName(request_id + ".jpg"); var image = sub_folder.createFile(image_data); image.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.VIEW); url = "https://drive.google.com/uc?export=download&id=" + image.getId(); } else if(type == "audio") { var audio_data = response.getBlob().setName(request_id + ".mp3"); var audio = sub_folder.createFile(audio_data); audio.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.VIEW); url = "https://drive.google.com/uc?export=download&id=" + audio.getId(); } else if(type == "video") { var video_data = response.getBlob().setName(request_id + ".mp4"); var video = sub_folder.createFile(video_data); video.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.VIEW); url = "https://drive.google.com/uc?export=download&id=" + video.getId(); } } catch(error) { if(type == "image") url = "Generate image url failed."; else if(type == "audio") url = "Generate audio url failed."; else if(type == "video") url = "Generate video url failed."; } return url; } function receive_msg_from_line(user_message, user_id, group_id, replyToken, time) { var url_reply = 'https://api.line.me/v2/bot/message/reply'; var url_profile = 'https://api.line.me/v2/bot/profile/'; if(user_message == "getid" || user_message == "getgroupid") { var send_id; if(user_message == "getid") send_id = user_id; else if(user_message == "getgroupid") send_id = group_id; UrlFetchApp.fetch(url_reply, { 'headers': { 'Content-Type': 'application/json; charset=UTF-8', 'Authorization': 'Bearer ' + ACCESS_TOKEN, }, 'method': 'post', 'payload': JSON.stringify({ 'replyToken': replyToken, 'messages': [{ 'type': 'text', 'text': send_id , }], 'notificationDisabled': 'true', }), }); log_save(send_id, "BOT", "IDs"); return; } try { var response = UrlFetchApp.fetch(url_profile + user_id, { 'headers': { 'Content-Type': 'application/json; charset=UTF-8', 'Authorization': 'Bearer ' + ACCESS_TOKEN, }, }); var profile_name = JSON.parse(response).displayName; } catch(error) { profile_name = "Unknown"; } user_message += "(" + time + ")"; if(group_id == "Unknown") log_save(user_message, profile_name, user_id); else log_save(user_message, profile_name, group_id); } function doPost(post_data) { var date = new Date(); var time = Utilities.formatDate( date, 'Asia/Tokyo', 'MM/dd hh:mm:ss'); var type = JSON.parse(post_data.postData.contents).type; var result; if(type == undefined) { var msg_id = JSON.parse(post_data.postData.contents).events[0].message.id; var user_message = JSON.parse(post_data.postData.contents).events[0].message.text; var user_id = JSON.parse(post_data.postData.contents).events[0].source.userId; var group_id = JSON.parse(post_data.postData.contents).events[0].source.groupId; var replyToken = JSON.parse(post_data.postData.contents).events[0].replyToken; var type = JSON.parse(post_data.postData.contents).events[0].message.type; if(user_id == undefined) user_id = "Unknown"; if(group_id == undefined) group_id = "Unknown"; if(type == "sticker") { var sticker_sticker_id = JSON.parse(post_data.postData.contents).events[0].message.stickerId; user_message = "<sticker>" + sticker_sticker_id + "</sticker>"; } else if(type == "image") { if(group_id == "Unknown") user_message = "<image_url>" + get_content_url(msg_id, user_id, type) + "</image_url>"; else user_message = "<image_url>" + get_content_url(msg_id, group_id, type) + "</image_url>"; } else if(type == "audio") { if(group_id == "Unknown") user_message = "<audio_url>" + get_content_url(msg_id, user_id, type) + "</audio_url>"; else user_message = "<audio_url>" + get_content_url(msg_id, group_id, type) + "</audio_url>"; } else if(type == "video") { if(group_id == "Unknown") user_message = "<video_url>" + get_content_url(msg_id, user_id, type) + "</video_url>"; else user_message = "<video_url>" + get_content_url(msg_id, group_id, type) + "</video_url>"; } else if(user_message == undefined) user_message += " : " + type + " " + msg_id; receive_msg_from_line(user_message, user_id, group_id, replyToken, time); return; } var client_auth = JSON.parse(post_data.postData.contents).auth; var client_gas_ver = JSON.parse(post_data.postData.contents).gas_ver; if(client_auth == undefined) client_auth = ""; if(client_gas_ver == undefined) client_gas_ver = -1; if(script_password == client_auth) { if(gas_ver == client_gas_ver) { if(type == "send_text") { var id = JSON.parse(post_data.postData.contents).id; var send_message = JSON.parse(post_data.postData.contents).message; result = send_msg(id, send_message, time); } else if(type == "send_sticker") { var id = JSON.parse(post_data.postData.contents).id; var package_id = JSON.parse(post_data.postData.contents).package_id; var sticker_id = JSON.parse(post_data.postData.contents).sticker_id; result = send_sticker(id, package_id, sticker_id, time); } else result = "Unknown message type."; } else result = "Google Apps Script version does not match. Server's GAS\nver is " + gas_ver + ", but 3DS's GAS ver is " + client_gas_ver + ". Please use the same version."; } else result = "Auth failed. Please set correct password."; return ContentService.createTextOutput(result); } function doGet(post_data) { var data = ""; var client_auth = post_data.parameter.script_auth; var client_gas_ver = post_data.parameter.gas_ver; if(client_auth == undefined) client_auth = ""; if(client_gas_ver == undefined) client_gas_ver = -1; if(script_password == client_auth) { if(gas_ver == client_gas_ver) { data = log_read(post_data.parameter.id); data += "<success>"; } else data = "Google Apps Script version does not match. Server's GAS\nver is " + gas_ver + ", but 3DS's GAS ver is " + client_gas_ver + ". Please use the same version."; } else data = "Auth failed. Please set correct password."; return ContentService.createTextOutput(data); }
'Then click Publish -> Deploy as web app and set "who has access to the app" is Anyone,even anonymous, finally click deploy.''''
Next click Review permissions and select your google account.
'If "This app isn't verified or You should avoid this app" shown click Advanced and click Go to Line main (unsafe) and click allow.'
Copy this url and save.'
'Back to Line Messaging API
Find Webhook URL and click edit.''''
Type your URL and click Update
'And turn on Use webhook'