how can I perform multiple functions that refer to different APIs? Also I would like that when I call my skill, it started with the presentation. But I can't do that, why?
const Alexa = require('alexa-sdk');const alexa_info = require('ask-sdk-core');
exports.handler = (event, context) => { const alexa = Alexa.handler(event, context); const skillBuilder = alexa_info.SkillBuilders.custom(); skillBuilder .addRequestHandlers( LaunchRequestHandler, GreetMeIntentHandler, EmailIntentHandler, MobileIntentHandler, HelpIntentHandler, CancelAndStopIntentHandler, SessionEndedRequestHandler ) .addRequestInterceptors(RequestLog) .addResponseInterceptors(ResponseLog) .addErrorHandlers(ErrorHandler) .withApiClient(new alexa_info.DefaultApiClient()) .lambda(); alexa.APP_ID = APP_ID; alexa.registerHandlers(handlers); alexa.execute(); };
and my launch Request is
const LaunchRequest = { canHandle(handlerInput) { return handlerInput.requestEnvelope.request.type === 'LaunchRequest'; }, handle(handlerInput) { return handlerInput.responseBuilder.speak(messages.WELCOME) .reprompt(messages.HELP) .reprompt(messages.WHAT_DO_YOU_WANT) .getResponse(); }, };