improve default built-in intents
This commit is contained in:
@@ -28,7 +28,8 @@ constants.SKILL_ID_LENGTH = 24;
|
||||
|
||||
constants.voiceResponseStrings = {
|
||||
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]
|
||||
|
||||
@@ -81,7 +81,7 @@ module.exports = {
|
||||
if (this.attributes['LaunchRequestYesNo']){
|
||||
this.attributes['LaunchRequestYesNo'] = false;
|
||||
}
|
||||
|
||||
|
||||
let intent = this.event.request.intent;
|
||||
|
||||
console.log ('Dialog state : ' + this.event.request.dialogState);
|
||||
@@ -192,12 +192,19 @@ module.exports = {
|
||||
if (this.attributes['LaunchRequestYesNo']){
|
||||
this.attributes['LaunchRequestYesNo'] = false;
|
||||
this.emit('HelpIntent');
|
||||
}else{
|
||||
this.response.speak(constants.voiceResponseStrings.DIDNT_ASK_ANYTHING).listen(constants.voiceResponseStrings.GENERIC_CONTINUE);
|
||||
this.emit(':responseReady');
|
||||
}
|
||||
}
|
||||
|
||||
handlers.NoIntent = function (){
|
||||
if (this.attributes['LaunchRequestYesNo']){
|
||||
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
|
||||
|
||||
handlers.NewSession = function(){
|
||||
this.attributes['LaunchRequestYesNo'] = false;
|
||||
}
|
||||
|
||||
handlers.SessionEndedRequest = function () {
|
||||
//We don't care for now
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user