diff --git a/backend/models/alexa.js b/backend/models/alexa.js
index 0ff79d8..271b528 100644
--- a/backend/models/alexa.js
+++ b/backend/models/alexa.js
@@ -12,7 +12,6 @@ module.exports = {
// Build the context manually, because Amazon Lambda is missing
var context = {
succeed: function (result) {
- console.log (result);
res.json (result);
},
fail: function (error) {
@@ -34,6 +33,17 @@ module.exports = {
handlers = {};
destinationEmail = activeSkill.contactEmail;
+ let listOfPossibleQuestions = '';
+ activeSkill.intents.map (intent => {
+ if (intent.questions.length > 0) {
+ listOfPossibleQuestions +=
+ intent.intentExplanation +
+ intent.questions[0] +
+ '';
+ }
+ });
+ console.log(listOfPossibleQuestions);
+
//Defaul Amazon handlers (some of them)
handlers.NewSession = function () {
@@ -41,16 +51,8 @@ module.exports = {
};
handlers['AMAZON.YesIntent'] = function () {
+ console.log("yes intent");
if (this.attributes['WantToHearQuestions']) {
- let listOfPossibleQuestions = '';
- activeSkill.intents.map (intent => {
- if (intent.questions.length > 0) {
- listOfPossibleQuestions +=
- intent.intentExplanation +
- intent.questions[0] +
- '';
- }
- });
this.response
.speak (listOfPossibleQuestions)
.listen(listOfPossibleQuestions);
@@ -63,9 +65,6 @@ module.exports = {
LaunchRequest: function () {
this.response
.speak (activeSkill.invocationAnswer)
- .speak (
- 'Would you like to hear questions that you can ask me ?'
- )
.listen (constants.voiceResponseStrings.GENERIC_CONTINUE); //Phrase from listen doesn't work !!!
this.attributes['WantToHearQuestions'] = true;