diff --git a/backend/models/alexa.js b/backend/models/alexa.js index 20a5e34..ad58067 100644 --- a/backend/models/alexa.js +++ b/backend/models/alexa.js @@ -24,6 +24,8 @@ module.exports = { alexa.execute (); }, updateModel: function () { + //TODO : Alexa-sdk has handlers like SessionEndedRequest, Unhandled ,... that can be used + //Get info from database, and store it for faster response on intent databaseHelper .getSkill (config.SKILL_DB_ID) @@ -31,7 +33,9 @@ module.exports = { handlers = {}; handlers = { LaunchRequest: function () { - this.response.listen (activeSkill.invocationAnswer);// Using listen so session doesn't end + this.response + .speak (activeSkill.invocationAnswer) + .listen (' Would you like to continue ?'); //TODO : Maybe to ask user does he want to hear possible intents //For this functionality, we need explanation text for each intent (Question) this.emit (':responseReady'); @@ -39,7 +43,9 @@ module.exports = { }; activeSkill.intents.map (intent => { handlers[intent.intentName] = function () { - this.response.listen (intent.answer); //Using listen so session doesn't end + this.response + .speak (intent.answer) + .listen ('Would you like to continue ?'); this.emit (':responseReady'); }; });