Test built-in intents

This commit is contained in:
GotPPay
2018-01-23 13:24:56 +01:00
parent a8ffe0a5c0
commit 39b8e7608e

View File

@@ -34,7 +34,7 @@ module.exports = {
destinationEmail = activeSkill.contactEmail;
let listOfPossibleQuestions = '';
activeSkill.intents.forEach(intent => {
activeSkill.intents.forEach (intent => {
if (intent.questions.length > 0 && intent.intentExplanation) {
listOfPossibleQuestions +=
intent.intentExplanation +
@@ -45,8 +45,6 @@ module.exports = {
}
});
console.log(listOfPossibleQuestions);
//Handler for launch requestconsole.log()
handlers = {
LaunchRequest: function () {
@@ -161,6 +159,26 @@ module.exports = {
}
};
//Built-In intents
handlers['AMAZON.CancelIntent'] = function () {
console.log ('Cancel');
this.reponse.speak ('Thank you for using Saburly');
this.emit (':responseReady');
};
handlers['AMAZON.HelpIntent'] = function () {
console.log ('Help');
};
handlers['AMAZON.NoIntent'] = function () {
console.log ('No');
};
handlers['AMAZON.YesIntent'] = function () {
console.log ('Yes');
};
//Default handlers for unknown questions and session close
handlers.Unhandled = function () {