Skip to content

Instantly share code, notes, and snippets.

@progapandist
Last active December 16, 2016 15:00
Show Gist options
  • Select an option

  • Save progapandist/8bbb7b31fe9fa0d50f95ee8b3b725260 to your computer and use it in GitHub Desktop.

Select an option

Save progapandist/8bbb7b31fe9fa0d50f95ee8b3b725260 to your computer and use it in GitHub Desktop.
Bot.on :message do |message|
puts "Received '#{message.inspect}' from #{message.sender}" # debug purposes
parsed_response = get_parsed_response(API_URL, message.text) # talk to Google API
message.type # trick user into thinking we type something with our fingers, HA HA HA
coord = extract_coordinates(parsed_response) # we have a separate method for that
message.reply(text: "Latitude: #{coord['lat']}, Longitude: #{coord['lng']}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment