Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 26 lines (23 sloc) 0.691 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# Description:
# Allows Hubot to help you decide between multiple options
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot decide "<option 1>" "<option 2>" "<option x>" - Randomly picks an option
# hubot decide <option1> <option2> <option3> - Randomly picks an option
#
# Author:
# logikal
# streeter

module.exports = (robot) ->
    robot.respond /decide "(.*)"/i, (msg) ->
        options = msg.match[1].split('" "')
        msg.reply("Definitely \"#{ msg.random options }\".")

    robot.respond /decide ([^"]+)/i, (msg) ->
        options = msg.match[1].split(' ')
        msg.reply("Definitely \"#{msg.random options}\".")
Something went wrong with that request. Please try again.