Skip to content

Instantly share code, notes, and snippets.

@thesifter
Forked from jamesmacfie/decision.coffee
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thesifter/42b6a336aa1dcb06e126 to your computer and use it in GitHub Desktop.
Save thesifter/42b6a336aa1dcb06e126 to your computer and use it in GitHub Desktop.
# 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