From b2386ea0d6520796aef77c04e9dca5456333ecde Mon Sep 17 00:00:00 2001 From: GotPPay Date: Tue, 23 Jan 2018 01:03:59 +0100 Subject: [PATCH] Yes and No intent dont work with dialog --- backend/helpers/amazon.js | 14 -------------- backend/models/alexa.js | 31 ++++++------------------------- 2 files changed, 6 insertions(+), 39 deletions(-) diff --git a/backend/helpers/amazon.js b/backend/helpers/amazon.js index 13bf567..fcc781e 100644 --- a/backend/helpers/amazon.js +++ b/backend/helpers/amazon.js @@ -64,20 +64,6 @@ var generateInteractionModel = function (skill) { let result = {}; let allIntents = []; - //Special Amazon intent - - allIntents.push ({ - name: 'YesIntent', - samples: ['Yes', 'Yes please', 'Sure'], - slots: [], - }); - - allIntents.push ({ - name: 'NoIntent', - samples: ['No', 'No thank you'], - slots: [], - }); - skill.intents.map (intent => { allIntents.push ({name: intent.intentName, samples: intent.questions}); }); diff --git a/backend/models/alexa.js b/backend/models/alexa.js index 22cbdc7..a08f6fb 100644 --- a/backend/models/alexa.js +++ b/backend/models/alexa.js @@ -42,40 +42,21 @@ module.exports = { ''; } }); - 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 + ' Would you like to hear possible questions ?') + .speak ( + activeSkill.invocationAnswer + + '' + + listOfPossibleQuestions + ) .listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!! - - this.attributes['WantToHearQuestions'] = true; - this.emit (':responseReady'); }, };