Yes and No intent dont work with dialog

This commit is contained in:
GotPPay
2018-01-23 01:03:59 +01:00
parent 2ae983d211
commit b2386ea0d6
2 changed files with 6 additions and 39 deletions

View File

@@ -42,40 +42,21 @@ module.exports = {
'<break time="1s"/>';
}
});
console.log(listOfPossibleQuestions);
//Defaul Amazon handlers (some of them)
handlers.NewSession = function () {
this.attributes['WaitingQuestions'] = false;
};
handlers['YesIntent'] = function () {
console.log("yes intent");
if (this.attributes['WaitingQuestions']) {
this.response
.speak (listOfPossibleQuestions)
.listen(constants.voiceResponseStrings.GENERIC_CONTINUE);
this.emit(':responseReady');
}
};
handlers['NoIntent'] = function () {
console.log("No intent");
if (this.attributes['WaitingQuestions']) {
this.attributes['WaitingQuestions'] = false;
}
};
handlers.NewSession = function () {};
//Handler for launch request
handlers = {
LaunchRequest: function () {
this.response
.speak (activeSkill.invocationAnswer + '<break time="650ms"/> Would you like to hear possible questions ?')
.speak (
activeSkill.invocationAnswer +
'<break time="650ms"/>' +
listOfPossibleQuestions
)
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!!
this.attributes['WantToHearQuestions'] = true;
this.emit (':responseReady');
},
};