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

28 lines (25 sloc) 0.742 kb
# Description:
# None
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot achievement get <achievement> [achiever's gravatar email] - life goals are in reach
#
# Author:
# Chris
module.exports = (robot) ->
robot.hear /achievement (get|unlock(ed)?) (.+?)(\s*[^@\s]+@[^@\s]+)?\s*$/i, (msg) ->
caption = msg.match[3]
email = msg.match[4] || msg.message.user.email_address
url = "http://achievement-unlocked.heroku.com/xbox/#{escape(caption)}.png"
if email
url += "?email=#{escape(email.trim())}.png"
msg.send(url)
robot.hear /acheivement (get|unlock(ed)?)/i, (msg) ->
url = "http://achievement-unlocked.heroku.com/xbox/#{escape("Bane of Daniel Webster")}.png"
msg.send(url)
Jump to Line
Something went wrong with that request. Please try again.