LINE Notifyにmessageを送る
他のframeworkで使用したいときは、UrlFetchApp/ScriptPropertiesなどを適切な函数に変更する
code:sendToLINE.ts
function sendToLine(message: string): void {
const token = ScriptProperties.getProperty('LINE_ACCESS_TOKEN');
if (!token) {
console.error('The LINE Notify access token is not found.');
return;
}
const options: GoogleAppsScript.URL_Fetch.URLFetchRequestOptions = {
method: 'post',
payload: message=${message},
headers: { Authorization: Bearer ${token} },
};
}