Last active
September 9, 2015 06:45
-
-
Save Yamotty/d574cbdd23217be47761 to your computer and use it in GitHub Desktop.
毎週のお掃除当番をSlackへランダムで通知する ref: http://qiita.com/Yamotti/items/b0eb3d855c4266b18b39
This file contains 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
//NameとFaceをランダムで取得して、Slackへ送る | |
function OSOJIKUN() { | |
var row = Math.floor(Math.random() * 5) + 2; | |
Logger.log(row); | |
var Name = sheetdata[row][0]; | |
var row2 = Math.floor(Math.random() * 5) + 2;//NameのrowをRandomで取得 | |
var Face = sheetdata[row2][1]; | |
var slackApp = SlackApp.create(slack["token"]);//FaceのrowをRandomで取得 | |
var Message = slackApp.postMessage(slack["ChannelId"], "```" + "今週のゴミ捨て当番は…" + Name + "!頼んだドン!" + Face + "```", {username : slack["userName"]}); | |
Logger.log(Message); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment