Created
September 26, 2014 02:17
-
-
Save jamesmacfie/6f19a1e9098f46674363 to your computer and use it in GitHub Desktop.
Simple hubot decision maker
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
# Description: | |
# Decides between two given options | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: | |
# hubot decide <answer one> or <answer two> | |
# | |
# Author: | |
# James Macfie | |
module.exports = (robot) -> | |
robot.respond /decide (.+?) or (.+?)$/i, (msg) -> | |
answer = Math.round(Math.random()) + 1 | |
msg.send 'I choose ' + msg.match[answer] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment