Created
May 24, 2012 00:21
-
-
Save coderoshi/2778586 to your computer and use it in GitHub Desktop.
Ca$hcat Hubot plugin
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
# Cashcatme. Just like pug bombing, but with flava | |
# | |
# cashcat me - Receive a cashcat | |
# cashcat bomb N - get N cashcats | |
module.exports = (robot) -> | |
robot.respond /cashcat me/i, (msg) -> | |
msg.http("http://cashcatme.heroku.com/bomb?count=1") | |
.get() (err, res, body) -> | |
msg.send JSON.parse(body).cats | |
robot.respond /cashcat bomb( (\d+|π))?/i, (msg) -> | |
count = msg.match[2] || 5 | |
count = 3 if count == "π" | |
msg.http("http://cashcatme.heroku.com/bomb?count=" + count) | |
.get() (err, res, body) -> | |
msg.send cat for cat in JSON.parse(body).cats |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment