usage
sendSlack("hoge");
関数
function getSlackURL(){
return "*** slack webhook ***";
}
function sendSlack(text){
const channel = "#channel_name";
const data = {
'channel': channel,
'username': 'bot',
'text': text,
'icon_emoji': ':ghost:'
};
const option = {
"method": "post",
"payload": JSON.stringify(data),
"muteHttpExceptions": true
};
UrlFetchApp.fetch(getSlackURL(), option);
}