Created
June 22, 2015 03:57
-
-
Save jhmartin/a8a95ec8b0954c322f8d to your computer and use it in GitHub Desktop.
Echo
This file contains 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
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