Skip to content

Instantly share code, notes, and snippets.

@arukayies
Created November 30, 2019 10:57
Show Gist options
  • Save arukayies/7b22a5d68a4914b4e3bdd1818477dc4d to your computer and use it in GitHub Desktop.
Save arukayies/7b22a5d68a4914b4e3bdd1818477dc4d to your computer and use it in GitHub Desktop.
【LINE BOT】GASでLINE Messaging APIを使って「スタンプメッセージ」の送り方
/*
スタンプメッセージを送る
———————————–*/
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だとユーザーに通知されない
}),
});
}
@arukayies
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment