Created
November 30, 2019 10:57
-
-
Save arukayies/7b22a5d68a4914b4e3bdd1818477dc4d to your computer and use it in GitHub Desktop.
【LINE BOT】GASでLINE Messaging APIを使って「スタンプメッセージ」の送り方
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
スタンプメッセージを送る | |
———————————–*/ | |
function pushmessage_sticker() { | |
/* スクリプトプロパティのオブジェクトを取得 */ | |
const prop = PropertiesService.getScriptProperties().getProperties(); | |
/* スタンプメッセージを送る */ | |
UrlFetchApp.fetch('https://api.line.me/v2/bot/message/push', { | |
'headers': { | |
'Content-Type': 'application/json', | |
'Authorization': 'Bearer ' + prop.TOKEN, // スクリプトプロパティにトークンは事前に追加しておく | |
}, | |
'method': 'POST', | |
'payload': JSON.stringify({ | |
"to": prop.DEBUGID, // スクリプトプロパティに送信先IDは事前に追加しておく | |
"messages": [{ | |
"type": "sticker", | |
"packageId": "11538", | |
"stickerId": "51626494" | |
}], | |
"notificationDisabled": false // trueだとユーザーに通知されない | |
}), | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
詳細はこちら
https://arukayies.com/gas/line_bot/pushmessage_sticker