diff --git a/lib/stealth/services/twilio/message_handler.rb b/lib/stealth/services/twilio/message_handler.rb index ea911bd..78e48e8 100644 --- a/lib/stealth/services/twilio/message_handler.rb +++ b/lib/stealth/services/twilio/message_handler.rb @@ -28,6 +28,7 @@ def process service_message.sender_id = params['From'] service_message.target_id = params['To'] service_message.message = params['Body'] + service_message.location = { latitude: params['Latitude'], longitude: params['Longitude'] } # Check for media attachments attachment_count = params['NumMedia'].to_i diff --git a/lib/stealth/services/twilio/reply_handler.rb b/lib/stealth/services/twilio/reply_handler.rb index 4f9c756..ff1ead1 100644 --- a/lib/stealth/services/twilio/reply_handler.rb +++ b/lib/stealth/services/twilio/reply_handler.rb @@ -73,6 +73,11 @@ def file format_response({ body: reply['text'], media_url: reply['file_url'] }) end + def location + check_text_length + format_response({ body: reply['text'], persistent_action: ["geo:#{reply['latitude']},#{reply['longitude']}|#{reply['label']}"] }) + end + def delay end