experiment with Yes and No intents
This commit is contained in:
@@ -47,24 +47,31 @@ module.exports = {
|
||||
//Defaul Amazon handlers (some of them)
|
||||
|
||||
handlers.NewSession = function () {
|
||||
this.attributes['WantToHearQuestions'] = false;
|
||||
this.attributes['WaitingQuestions'] = false;
|
||||
};
|
||||
|
||||
handlers['AMAZON.YesIntent'] = function () {
|
||||
console.log("yes intent");
|
||||
if (this.attributes['WantToHearQuestions']) {
|
||||
if (this.attributes['WaitingQuestions']) {
|
||||
this.response
|
||||
.speak (listOfPossibleQuestions)
|
||||
.listen(listOfPossibleQuestions);
|
||||
.listen(constants.voiceResponseStrings.GENERIC_CONTINUE);
|
||||
this.emit(':responseReady');
|
||||
}
|
||||
};
|
||||
|
||||
handlers['AMAZON.NoIntent'] = function () {
|
||||
console.log("No intent");
|
||||
if (this.attributes['WaitingQuestions']) {
|
||||
this.attributes['WaitingQuestions'] = false;
|
||||
}
|
||||
};
|
||||
|
||||
//Handler for launch request
|
||||
handlers = {
|
||||
LaunchRequest: function () {
|
||||
this.response
|
||||
.speak (activeSkill.invocationAnswer)
|
||||
.speak (activeSkill.invocationAnswer + '<break time="1s"/> Would you like to hear possible questions ?')
|
||||
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!!
|
||||
|
||||
this.attributes['WantToHearQuestions'] = true;
|
||||
|
||||
Reference in New Issue
Block a user