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

1971
web/package-lock.json generated

File diff suppressed because it is too large Load Diff