I am developing Alexa skill in which I have few questions. For two of the questions (Q1, Q2) Alexa is answering the correct answer (Answer1, Answer2) but for the other questions (Q3, Q4) it is answering (Answer1, Answer2).
Here is my code:
'use strict';
var APP_ID = ' ';
var CLIMATE_OUTPUT = 'Bangalore has a tropical savanna climate with distinct wet and dry seasons.';
var BENGALURU_DETAILS_OUTPUT = 'Bangalore, officially known as Bengaluru, is the capital of the Indian state of Karnataka. ';
var POPULATION_OUTPUT = 'It has a population of over ten million';
var POLLUTION_OUTPUT = 'Bangalore generates about 3,000 tonnes of solid waste per day';
var skill = require('./Skill.js');
var Service = function() {
skill.call(this, APP_ID);
};
Service.prototype = Object.create(skill.prototype);
var detailsResponseFunction = function(intent, session, response) {
response.tell(BENGALURU_DETAILS_OUTPUT);
};
var populationResponseFunction = function(intent, session, response) {
response.tell(POPULATION_OUTPUT);
};
var climateResponseFunction = function(intent, session, response) {
response.tell(CLIMATE_OUTPUT);
};
var pollutionResponseFunction = function(intent, session, response) {
response.tell(POLLUTION_OUTPUT);
};
Service.prototype.intentHandlers = {
'bengaluruDetails': detailsResponseFunction,
'population': populationResponseFunction,
'climate': climateResponseFunction,
'pollution': pollutionResponseFunction
};
exports.handler = function(event, context) {
var service = new Service();
service.execute(event, context);
};
The way of questioning was wrong. For any custom skill we have to ask questions like---"ask {invocation name} {question}.