Plugin.command(:image, /(^@#{sn}\s+)?(.+)\s+画像/) do |obj|

  word = obj.match(1)
  uri = URI.parse(URI.encode("http://ajax.googleapis.com/ajax/services/search/images?q=#{word}&v=1.0&hl=ja&rsz=large&start=1&safe=off"))
  req = Net::HTTP::Get.new(uri.path)
  http = Net::HTTP.new(uri.host, uri.port)
  response = http.start do |h|
    h.request(req)
  end
  json = JSON.parse(response.body, {symbolize_names: true})

  raise Hk::Error::ErrorException, json[:responseDetails] unless json[:responseData]
  raise Hk::Error::HttpError, "HTTP Error code #{response.code}" unless response.code == "200"
  raise Hk::Error::ErrorException, "URL is empty." if json[:responseData][:results][0]

  image = json[:responseData][:results][0][:url]
  obj.reply("#{word}の画像です。 #{image}")

end