close session after finishing intent

This commit is contained in:
GotPPay
2018-04-18 00:26:41 +02:00
parent 26e186bf3a
commit 95b8fea01a
2 changed files with 209 additions and 1788 deletions

View File

@@ -61,7 +61,7 @@ module.exports = {
'ms"/>' +
'Would you like to hear list of questions that you can ask me'
)
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!!
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE);
this.attributes['LaunchRequestYesNo'] = true;
this.emit (':responseReady');
},
@@ -121,14 +121,12 @@ module.exports = {
answerPromise
.then (answer => {
this.response
.speak (answer)
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!!
.speak (answer);
this.emit (':responseReady');
})
.catch (error => {
this.response
.speak (error)
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!!
.speak (error);
this.emit (':responseReady');
});
};
@@ -242,7 +240,7 @@ module.exports = {
}
this.response
.speak (listOfPossibleQuestions)
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!!
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE);
this.emit (':responseReady');
};
@@ -252,8 +250,7 @@ module.exports = {
this.emit ('HelpIntent');
} else {
this.response
.speak (constants.voiceResponseStrings.DIDNT_ASK_ANYTHING)
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE);
.speak (constants.voiceResponseStrings.DIDNT_ASK_ANYTHING);
this.emit (':responseReady');
}
};
@@ -262,13 +259,11 @@ module.exports = {
if (this.attributes['LaunchRequestYesNo']) {
this.attributes['LaunchRequestYesNo'] = false;
this.response
.speak ('')
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE);
.speak ('');
this.emit (':responseReady');
} else {
this.response
.speak (constants.voiceResponseStrings.DIDNT_ASK_ANYTHING)
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE);
.speak (constants.voiceResponseStrings.DIDNT_ASK_ANYTHING);
this.emit (':responseReady');
}
};
@@ -277,14 +272,15 @@ module.exports = {
handlers.Unhandled = function () {
this.response
.speak (constants.voiceResponseStrings.QUESTION_NOT_FOUND)
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE);
.speak (constants.voiceResponseStrings.QUESTION_NOT_FOUND);
this.emit (':responseReady');
};
//Session handlers
handlers.SessionEndedRequest = function () {
//We don't care for now
this.response.speak (`Thank you for using ${skillName}`);
this.emit (':responseReady');
};
})
.catch (e => {

1971
web/package-lock.json generated

File diff suppressed because it is too large Load Diff