diff --git a/backend/config/constants.js b/backend/config/constants.js index 7c3a7df..25a738e 100644 --- a/backend/config/constants.js +++ b/backend/config/constants.js @@ -28,7 +28,8 @@ constants.SKILL_ID_LENGTH = 24; constants.voiceResponseStrings = { QUESTION_NOT_FOUND : 'Sorry, I didnt understand', - GENERIC_CONTINUE : 'Would you like to continue' + GENERIC_CONTINUE : 'Would you like to continue', + DIDNT_ASK_ANYTHING : 'There was no question to answer to', } //Timing is given in [ms] diff --git a/backend/models/alexa.js b/backend/models/alexa.js index f227abf..68c7aac 100644 --- a/backend/models/alexa.js +++ b/backend/models/alexa.js @@ -81,7 +81,7 @@ module.exports = { if (this.attributes['LaunchRequestYesNo']){ this.attributes['LaunchRequestYesNo'] = false; } - + let intent = this.event.request.intent; console.log ('Dialog state : ' + this.event.request.dialogState); @@ -192,12 +192,19 @@ module.exports = { if (this.attributes['LaunchRequestYesNo']){ this.attributes['LaunchRequestYesNo'] = false; this.emit('HelpIntent'); + }else{ + this.response.speak(constants.voiceResponseStrings.DIDNT_ASK_ANYTHING).listen(constants.voiceResponseStrings.GENERIC_CONTINUE); + this.emit(':responseReady'); } } handlers.NoIntent = function (){ if (this.attributes['LaunchRequestYesNo']){ this.attributes['LaunchRequestYesNo'] = false; + this.response.listen(constants.voiceResponseStrings.GENERIC_CONTINUE); + }else{ + this.response.speak(constants.voiceResponseStrings.DIDNT_ASK_ANYTHING).listen(constants.voiceResponseStrings.GENERIC_CONTINUE); + this.emit(':responseReady'); } } @@ -211,10 +218,6 @@ module.exports = { //Session handlers - handlers.NewSession = function(){ - this.attributes['LaunchRequestYesNo'] = false; - } - handlers.SessionEndedRequest = function () { //We don't care for now };