My skill times out with an error, "There was a problem with the requested skill's response."
I'm trying to end the session silently if the user does not say anything on both initial prompt and reprompt.
Currently, if the user says nothing the first time, it kicks off the reprompt.
If they say nothing after the reprompt, Alexa says the error message: "There was a problem with the requested skill's response."
Lambda function:
'use strict';
const Alexa = require('alexa-sdk');
const APP_ID = undefined;
const handlers = {
'LaunchRequest': function () {
const launchMsg = "How can I help you?";
const reprompt = "You can say, give me the weather.";
this.response.speak( launchMsg )
.listen( reprompt );
// errors out here on .listen if no input
this.emit(':responseReady');
},
'WeatherIntent': function () {
this.response.speak( 'It is 100 degrees Kelvin' )
this.emit(':responseReady');
}
}
exports.handler = function (event, context, callback) {
const alexa = Alexa.handler(event, context);
alexa.APP_ID = APP_ID;
alexa.resources = languageStrings;
alexa.registerHandlers(handlers);
alexa.execute();
};
Failed attempts:
// this.response.speak( launchMsg ).listen( reprompt, function(){this.emit('SessionEndedRequest')} );
// this.response.speak( launchMsg ).listen( reprompt, this.emit('SessionEndedRequest') );
// this.response.speak( launchMsg ).listen( reprompt, this.response.shouldEndSession(true) );
// this.response.shouldEndSession(true).speak( launchMsg ).listen( reprompt );
// this.response..speak( launchMsg ).listen( reprompt ).shouldEndSession(true);
// this.response.speak( 'goodbye' ).listen( reprompt ).speak( launchMsg );
// this.response.speak( launchMsg ).listen( reprompt ).speak( 'goodbye' );
// this.response.speak( launchMsg ).listen( reprompt, this.emit(":tell", "goodbye") );
// this.response.speak( launchMsg ).listen( reprompt).speak('goodbye');
// this.response.speak( launchMsg ).listen( reprompt, true );
// this.response.speak.listen( reprompt, false );
// this.response.speak.listen( true, reprompt );
// this.response.speak.listen( false, reprompt );
// this.emit(':responseReady', function(){this.emit('SessionEndedRequest')});
// this.emit(':responseReady', this.emit('SessionEndedRequest') );
// this.emit(':responseReady', this.response.shouldEndSession(true));
// this.emit(':responseReady', function(){this.response.shouldEndSession(true)} );