Skip to content

Instantly share code, notes, and snippets.

@wendeehsu
Created May 29, 2021 08:04
Show Gist options
  • Save wendeehsu/75c968deb78e534225774dfc7c9f155f to your computer and use it in GitHub Desktop.
Save wendeehsu/75c968deb78e534225774dfc7c9f155f to your computer and use it in GitHub Desktop.
function pushMsg(message, usrId) {
var opt = {
'headers': {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer ' + channelToken,
},
'method': 'post',
'payload': JSON.stringify({
'to': usrId,
'messages': [{'type': 'text', 'text': message}]
})
};
UrlFetchApp.fetch('https://api.line.me/v2/bot/message/push', opt);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment