Merge pull request #30 from fastestforward/achievement-get

Achievement get
This commit is contained in:
Corey Donohoe 2011-10-29 16:32:15 -07:00
Родитель 40dcc40c0b b9c622af9d
Коммит b5bbea3105
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,15 @@
#
# achievement get <achievement> [achiever's gravatar email] - life goals are in reach.
#
module.exports = (robot) ->
robot.hear /achievement (get|unlock(ed)?) (.+?)(\s*[^@\s]+@[^@\s]+)?\s*$/i, (msg) ->
caption = msg.match[3]
email = msg.match[4]
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)