keep session open - fix
This commit is contained in:
@@ -24,6 +24,8 @@ module.exports = {
|
|||||||
alexa.execute ();
|
alexa.execute ();
|
||||||
},
|
},
|
||||||
updateModel: function () {
|
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
|
//Get info from database, and store it for faster response on intent
|
||||||
databaseHelper
|
databaseHelper
|
||||||
.getSkill (config.SKILL_DB_ID)
|
.getSkill (config.SKILL_DB_ID)
|
||||||
@@ -31,7 +33,9 @@ module.exports = {
|
|||||||
handlers = {};
|
handlers = {};
|
||||||
handlers = {
|
handlers = {
|
||||||
LaunchRequest: function () {
|
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
|
//TODO : Maybe to ask user does he want to hear possible intents
|
||||||
//For this functionality, we need explanation text for each intent (Question)
|
//For this functionality, we need explanation text for each intent (Question)
|
||||||
this.emit (':responseReady');
|
this.emit (':responseReady');
|
||||||
@@ -39,7 +43,9 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
activeSkill.intents.map (intent => {
|
activeSkill.intents.map (intent => {
|
||||||
handlers[intent.intentName] = function () {
|
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');
|
this.emit (':responseReady');
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user