Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function doPost(y) {
var token = PropertiesService.getScriptProperties().getProperty("xoxp-123");
var name = "name";
var token = PropertiesService.getScriptProperties().getProperty('SLACK_ACCESS_TOKEN');
var app = SlackApp.create(token);
var spreadsheet = SpreadsheetApp.openById('sheetID');
var sheet = spreadsheet.getSheetByName('シート1');
var range = sheet.getRange("シート1!C1").setFormula('=INDIRECT("シート1!A:A" & INT(RAND()*n+1))');
var range2 = sheet.getRange("シート1!D1").setFormula('=INDIRECT("シート1!B:B" & INT(RAND()*n+1))');
var message =sheet.getRange("シート1!C1").getValue()+sheet.getRange("シート1!D1").getValue();
return app.postMessage("#general", message, {
username: name,
icon_emoji: ':emojiname:'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.