Skip to content

Instantly share code, notes, and snippets.

@webdesserts
Created August 13, 2012 04:33
Show Gist options
  • Save webdesserts/3336992 to your computer and use it in GitHub Desktop.
Save webdesserts/3336992 to your computer and use it in GitHub Desktop.
Corgi Bomb modified
# 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