improve default built-in intents

This commit is contained in:
GotPPay
2018-01-24 13:02:46 +01:00
parent c0a177d39b
commit adc1f1c099
2 changed files with 10 additions and 6 deletions

View File

@@ -28,7 +28,8 @@ constants.SKILL_ID_LENGTH = 24;
constants.voiceResponseStrings = { constants.voiceResponseStrings = {
QUESTION_NOT_FOUND : 'Sorry, I didnt understand', QUESTION_NOT_FOUND : 'Sorry, I didnt understand',
GENERIC_CONTINUE : 'Would you like to continue' GENERIC_CONTINUE : 'Would you like to continue',
DIDNT_ASK_ANYTHING : 'There was no question to answer to',
} }
//Timing is given in [ms] //Timing is given in [ms]

View File

@@ -81,7 +81,7 @@ module.exports = {
if (this.attributes['LaunchRequestYesNo']){ if (this.attributes['LaunchRequestYesNo']){
this.attributes['LaunchRequestYesNo'] = false; this.attributes['LaunchRequestYesNo'] = false;
} }
let intent = this.event.request.intent; let intent = this.event.request.intent;
console.log ('Dialog state : ' + this.event.request.dialogState); console.log ('Dialog state : ' + this.event.request.dialogState);
@@ -192,12 +192,19 @@ module.exports = {
if (this.attributes['LaunchRequestYesNo']){ if (this.attributes['LaunchRequestYesNo']){
this.attributes['LaunchRequestYesNo'] = false; this.attributes['LaunchRequestYesNo'] = false;
this.emit('HelpIntent'); this.emit('HelpIntent');
}else{
this.response.speak(constants.voiceResponseStrings.DIDNT_ASK_ANYTHING).listen(constants.voiceResponseStrings.GENERIC_CONTINUE);
this.emit(':responseReady');
} }
} }
handlers.NoIntent = function (){ handlers.NoIntent = function (){
if (this.attributes['LaunchRequestYesNo']){ if (this.attributes['LaunchRequestYesNo']){
this.attributes['LaunchRequestYesNo'] = false; this.attributes['LaunchRequestYesNo'] = false;
this.response.listen(constants.voiceResponseStrings.GENERIC_CONTINUE);
}else{
this.response.speak(constants.voiceResponseStrings.DIDNT_ASK_ANYTHING).listen(constants.voiceResponseStrings.GENERIC_CONTINUE);
this.emit(':responseReady');
} }
} }
@@ -211,10 +218,6 @@ module.exports = {
//Session handlers //Session handlers
handlers.NewSession = function(){
this.attributes['LaunchRequestYesNo'] = false;
}
handlers.SessionEndedRequest = function () { handlers.SessionEndedRequest = function () {
//We don't care for now //We don't care for now
}; };