Last active
December 16, 2016 15:00
-
-
Save progapandist/8bbb7b31fe9fa0d50f95ee8b3b725260 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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