on_intent("SELECT_DISLIKES") do
# Access the slots
slots = request.intent.slots
puts slots.to_s
# pull in the users from the amazon.US.FIRST_NAME Slot
dislikes = request.intent.slots["dislikes"]
response.should_end_session = false
session_attributes[:userName]
session_attributes[:ingredients]
session_attributes[:cuisine]
session_attributes[:dislikes] = dislikes
session_attributes[:intolerances] = ""
session_attributes[:diet] = ""
# Create an array of greetings to add variation
confirmations = [" Gotcha, I\'ll filter out recipes with ", " Good to know, i\'ll be sure to avoid "]
prompts = [" While we are on the subject do you have any allergies? ", "Are you allergic to anything by chance?"]
# add a response to Alexa using ssml to add pauses
response.set_output_speech_ssml('<speak>' + confirmations.sample + dislikes + '. ' + prompts.sample + '</speak>')
# create a card response in the alexa app
response.set_simple_card("sous", "dislikes")
# log the output if needed
logger.info 'dislikes processed'
end
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .