Skip to content

Commit

Permalink
Merge pull request github#304 from djljr/master
Browse files Browse the repository at this point in the history
Show Magic: The Gathering card art in chat
  • Loading branch information
atmos committed Feb 17, 2012
2 parents 9eb44cf + 4081320 commit dfcb8e4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/scripts/mtg.coffee
@@ -0,0 +1,13 @@
#
# Insert Pictures of Magic: The Gathering Cards
#
# cast <card name> - a picture of the named magic card

querystring = require 'querystring';

module.exports = (robot) ->
robot.respond /cast (.+)/i, (msg) ->
url = "http://gatherer.wizards.com/Handlers/Image.ashx"
card = msg.match[1] || "Dismal%20Failure"
query = { type: "card", name: card }
msg.send "#{url}?#{querystring.stringify(query)}#.jpg"

0 comments on commit dfcb8e4

Please sign in to comment.