Closed shvedPetro closed 5 years ago
That doesn't look like the right line number for me... what is the text of the line you put that after to make it work? Did you discover anything else using this example?
The skill is designed to tell a fact and then exit, so the behavior @shvedPetro describes is expected.
The .reprompt(repromptOutput) would be added to the GetNewFactHandler, in this part of the code:
return handlerInput.responseBuilder
.speak(speakOutput)
.withSimpleCard(requestAttributes.t('SKILL_NAME'), randomFact)
.getResponse();
modifying it to listen for a response (and reusing the speak output value in this example, however whenever you are reprompting, the output should end with a question which the fact does not)
return handlerInput.responseBuilder
.speak(speakOutput)
.reprompt(speakOutput)
.withSimpleCard(requestAttributes.t('SKILL_NAME'), randomFact)
.getResponse();
Alexa and I were confused about invocation name and intent's slots. If speaking out invocation name to Alexa would trigger a piece of space facts, why bother intent's slots? i.e.
- Alexa, open space facts.
- Here is a piece of fact, the sun....
- tell me a fact
..(silent)..
I am also confused, if there are alternatives to trigger the skill?
Space facts is a simple skill which only does one thing - tell you a fact. As a result, invoking the skill essentially does the same thing as invoking the skill and asking for a fact in a single utterance. However, since the session is not kept open (in the way the code is currently setup), it is not possible to access the other functionality (like help), without combining it into a single utterance along with invoking the skill. Since there are other intents, the Get Fact intent must also exist.
There are also multiple words and phrasing you can use to invoke a skill. Check this out: https://developer.amazon.com/docs/custom-skills/understanding-how-users-invoke-custom-skills.html
After i call "open space facts". It's give me a fact, but if after i say "tell me a fact", it's not working, "Sorry, I don't know that". But if i put .reprompt(speakOutput) after line 27 in index.js, it's start working well.