Closed oliviachang29 closed 6 years ago
I don't know that there is a deterministic way to anticipate which intent Alexa will call when there are multiple that match to the same utterance - in this case a number. I liked Cicil's answer at StackOverflow, to just have one number intent. After that if you update the canHandle
methods of PlayerCountHandler
and AnswerHandler
to look for that intent instead of the previous ones you should have what you want.
I want users to be able to answer trivia questions with a number, instead of a word, so I changed the slot type of AnswerQuestionIntent and AnswerOnlyIntent to "AMAZON.NUMBER" (instead of the slot type "answers").
But the dialog ends up like this:
(note: if the user responds with anything other than a number, Alexa will say
"Welcome to Better with Buttons Trivia. This game supports up to 4 players. How many players are there?"
)Looking at debugging info from the Device Log, I can see that Alexa thinks that the intent is AnswerOnlyIntent, instead of PlayerCount:
Why does Alexa think that the user wants AnswerOnlyIntent instead of PlayerCount, and how can I fix this? It looks to me from the handlers that AnswerOnlyIntent should only be called when the game state is
settings.STATE.BUTTON_GAME_STATE
orsettings.STATE.BUTTONLESS_GAME_STATE
.I also made a StackOverflow issue here.