Reference Site
https://gurishunin.com/line_gas_beginner/
I'm a beginner.
I copied the above site's code and put a channel access token (long term) in the access token.
There is also a webnock setting and a URL (pressing verification shows success).
However, even if I send a message after registering as a friend, they won't parrot me back.
Could you tell me what caused it?
[Source code for above site]
// Access tokens listed in LINE developers message sending and receiving settings
constACCESS_TOKEN = 'Long Term Access Tokens';
function doPost(e){
// Response Token Received by WebHook
var replyToken=JSON.parse(e.postData.contents).events[0].replyToken;
// Get user messages
var userMessage=JSON.parse(e.postData.contents).events[0].message.text;
// API URL for response messages
varurl='https://api.line.me/v2/bot/message/reply';
UrlFetchApp.fetch(url,{
'headers': {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer' + ACCESS_TOKEN,
},
'method': 'post',
'payload': JSON.stringify({
'replyToken': replyToken,
'messages': [{
'type': 'text',
'text': userMessage,
}],
}),
});
returnContentService.createTextOutput(JSON.stringify({'content':'postok'}))).setMimeType(ContentService.MimeType.JSON);
}
Settings
webhook→on
Response Message → Disabled
Greeting message → Enabled
Using webhook→on
I checked the log safely and found an error!
How to Review Logs Using GCP
https://qiita.com/sa9ra4ma/items/1acb459fcc713728c03e
Let me ask you a new question!
Thank you!
581 PHP ssh2_scp_send fails to send files as intended
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.