I want to parrot back on Line, but it doesn't come back.

Asked 1 years ago, Updated 1 years ago, 297 views

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

google-apps-script line bot

2022-10-02 01:00

1 Answers

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!


2022-10-02 01:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.