Created
August 13, 2012 04:33
-
-
Save webdesserts/3336992 to your computer and use it in GitHub Desktop.
Corgi Bomb modified
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
# Description: | |
# Corgime | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: | |
# hubot corgi me - Receive a corgi | |
# hubot corgi bomb N - get N corgis | |
# | |
# Author: | |
# alexgodin | |
module.exports = (robot) -> | |
robot.respond /corgi me/i, (msg) -> | |
msg.http("http://corgibomb.heroku.com/random") | |
.get() (err, res, body) -> | |
msg.send body | |
robot.respond /corgi bomb( (\d+))?/i, (msg) -> | |
count = msg.match[2] || 5 | |
if count > 100 | |
msg.send "shit dun bust" | |
else | |
msg.http("http://corgibomb.heroku.com/bomb/" + count) | |
.get() (err, res, body) -> | |
msg.send corgi for corgi in JSON.parse(body) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment