Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (11 sloc) 419 Bytes
#
# 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"
Jump to Line
Something went wrong with that request. Please try again.