The Space Fact skill has an array of facts. So all you have to do is to pick one from the array when the user says "Next" or "One more".
Use AMAZON.NextIntent
In order to capture the user's "Next" utterance, use the predefined AMAZON.NextIntent
in your interaction model. So when the users say "Next" this intent will be mapped. Also add "one more" as an extra utterance for this intent.
Now, in your backend code add AMAZON.NextIntent
handler and for its response get another fact from the fact array. (Add some logic so that the skill wont randomly return the same fact again. You can use sessionAttributes
to keep track of read fact indexes)
Note: In order for Alexa to wait for users input after it says the first fact, you need to keep the session alive. As far as I remember the fact skill ends the session after it says the first fact.
The session is kept alive based on shouldEndSession
parameter in the response. For any request, if not provided, shouldEndSession
defaults to true
. In your case, the response to LaunchRequest
should have this shouldEndSession
parameter set to false
. Only by which the session remains open and users can say "next".
Read this answer to know more about how you can keep the session alive using ask-nodejs-sdk.