Created
June 16, 2014 12:44
-
-
Save shokai/3b14c8fc990d90c09be1 to your computer and use it in GitHub Desktop.
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
## 1つランダムに選ぶ | |
_ = require 'lodash' | |
module.exports = (robot) -> | |
robot.respond /choice (.+)/i, (msg) -> | |
items = msg.match[1].split(/\s+/) | |
choice = _.sample items | |
msg.send "厳正な抽選の結果、「#{choice}」に決まりました" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment