From 39b8e7608e17de015447deb037c1e5a521af14a6 Mon Sep 17 00:00:00 2001 From: GotPPay Date: Tue, 23 Jan 2018 13:24:56 +0100 Subject: [PATCH] Test built-in intents --- backend/models/alexa.js | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/backend/models/alexa.js b/backend/models/alexa.js index 8a31a0d..49539ff 100644 --- a/backend/models/alexa.js +++ b/backend/models/alexa.js @@ -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 () {