Skip to content

Instantly share code, notes, and snippets.

@jhmartin
Created June 22, 2015 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhmartin/a8a95ec8b0954c322f8d to your computer and use it in GitHub Desktop.
Save jhmartin/a8a95ec8b0954c322f8d to your computer and use it in GitHub Desktop.
Echo
if (request.type == 'LAUNCH_REQUEST')
# Process your Launch Request
# Call your methods for your application here that process your Launch Request.
response.add_speech('House Control online')
response.add_hash_card( { :title => 'My House', :subtitle => 'House Control activated.' } )
end
if (request.type == 'INTENT_REQUEST')
# Process your Intent Request
p "#{request.slots['helper']['value']}"
p "#{request.name}"
if (request.slots['helper']['value'] =~ /(good\s*night|bed\s*time)/i)
resp = sqs.send_message({queue_url: qurl,
message_body: "goodnight"
})
p resp
response.add_speech("Shutting down the house for the night. Goodnight!")
response.add_hash_card( { :title => 'Ruby Intent', :subtitle => "Intent #{request.name}" } )
elsif (request.slots['helper']['value'] =~ /(good\s*bye)/i)
response.add_speech("I will shut everything off and lock up in 2 minutes. Have a nice trip.")
response.add_hash_card( { :title => 'Ruby Intent', :subtitle => "Intent #{request.name}" } )
end
#response.add_speech("I received an intent named #{request.name} with value #{request.slots['helper']['value']}")
#response.add_hash_card( { :title => 'Ruby Intent', :subtitle => "Intent #{request.name}" } )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment