// index.js | |
app.intent('challengeHint', (conv) => { | |
// get the data that is saved on the user | |
let challengesName = conv.user.storage.currentChallenge; | |
let level = conv.user.storage.currentLevel; | |
// if they don't have a challengeName, then we tell them a | |
// message | |
if (!challengeName){ | |
conv.ask(new SimpleResponse({ | |
speech: noChallengeresponse['speech'}, | |
text: noChallengeresponse['text'], | |
})); | |
conv.ask(new Suggestions( | |
choose(responses.commmonSuggestions, 2) | |
)); | |
} else { | |
// figures out which question the user is on | |
let question = findQuestion(level, challengesName); | |
// sends hint to user | |
conv.ask(new SimpleResponse({ | |
speech: question['hintSpeech'], | |
text: question['hintText'], | |
})); | |
conv.ask(new Suggestions('Solution', 'Repeat Problem') | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment