Use AMAZON.YesIntent
intent to capture "Yes" inputs from the user.
When the user asks for announcements use sessionAttributes
along with your response to keep track of the read announcement indexes. So that when the user says "Yes", you can use this session attribute to read the next set of announcements. You can also set a STATE
attribute too, so that you can validate the state in AMAZON.YesIntent
handler before you give the next set of announcements.
Ex:
...
"sessionAttributes": {
"announcements_index": [0,1,2,3],
"STATE": "READ_ANNOUNCEMENTS"
}
...
When the user say "Yes", in your AMAZON.YesIntent
handler check whether the state is READ_ANNOUNCEMENTS
and based on the announcements_index
give the next set of announcements from your announcements list. And in sessionAttributes
update the announcements_index
.
There is chance that user might say "No", for "Do you want to hear more?". So add a AMAZON.NoIntent
too and handle it accordingly.
Do not forget to clear announcements_index
and STATE
when use case is done.
More on sessionAttributes
and Response Parameters here