Created
August 5, 2021 13:16
-
-
Save CUEICHI/f6ca9e7e299aa71ef53daf162b34a300 to your computer and use it in GitHub Desktop.
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 myFunction() { | |
| } | |
| URL = #Webhook URL | |
| BOTNAME = "面談update" | |
| function slackMsg(){ | |
| var mySheet = SpreadsheetApp.getActiveSheet() ; | |
| var myCell = mySheet.getActiveCell(); | |
| var r = myCell.getRow(); | |
| var c = myCell.getColumn(); | |
| var confTime = mySheet.getRange(r, 1).getDisplayValue(); //時間指定の列=1 | |
| var confDate = mySheet.getRange(3, c).getDisplayValue(); // 日付指定の行 = 3 | |
| var msg = confDate + "の" + confTime + "からの" + | |
| "予定が更新されました.変更内容は ["+ | |
| myCell.getValue() + "]です.(" + myCell.getA1Notation() + ")" ; | |
| var payload = { | |
| username : BOTNAME, | |
| // channel : USERNAME, | |
| text : msg | |
| }; | |
| var options = { | |
| 'method' : 'post', | |
| 'contentType': 'application/json', | |
| 'payload' : JSON.stringify(payload) | |
| }; | |
| var res = UrlFetchApp.fetch(URL, options); | |
| console.log(options); | |
| console.log(res.getHeaders()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment