respond(/pug me/i) do response = JSON.parse Net::HTTP.get(URI "http://pugme.herokuapp.com/random") say "<#{response["pug"]}>" end respond(/pug bomb( (\d+))?/i) do |message| count = message.match[2] || 5 response = JSON.parse Net::HTTP.get(URI "http://pugme.herokuapp.com/bomb?count=#{count}") response["pugs"].each do |pug| say "<#{pug}>" end end