Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (25 sloc) 0.595 kb
# 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
msg.http("http://corgibomb.heroku.com/bomb/" + count)
.get() (err, res, body) ->
msg.send corgi for corgi in JSON.parse(body)
Jump to Line
Something went wrong with that request. Please try again.