keep session open - fix

This commit is contained in:
GotPPay
2018-01-18 21:56:56 +01:00
parent 6bfd4adcaf
commit 9e4b06bd4c

View File

@@ -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');
};
});