获取RequestId:<some_random_id>在Lambda中为Alexa技能完成请求错误之前退出流程

时间:2018-06-11 15:59:59

标签: alexa alexa-skills-kit

这是我在AWS Lambda函数中编写的代码,用于构建alexa技能。但是我收到了这个错误

  

&#34; RequestId:some_random_id在完成请求之前退出流程   错误&#34;

任何人都可以帮助我吗?

'use strict';
 const Alexa = require('alexa-sdk');
 const APP_ID = undefined;
 const SKILL_NAME = 'Space Facts';
 const GET_FACT_MESSAGE = "Here's your fact: ";
 const HELP_MESSAGE = 'You can say tell me a space fact, or, you can      say exit... What can I help you with?';
 const HELP_REPROMPT = 'What can I help you with?';
 const STOP_MESSAGE = 'Goodbye!';

 const handlers = {
     'LaunchRequest': function () {
         this.emit(':ask', 'Welcome to my world');
     },
     'Unhandled': function(){
       this.emit(':tell', "Sorry, I don\'t want to do");
     },
     'AMAZON.HelpIntent': function () {
         const speechOutput = HELP_MESSAGE;
         const reprompt = HELP_REPROMPT;
         this.response.speak(speechOutput).listen(reprompt);
         this.emit(':responseReady');
     },
     'AMAZON.CancelIntent': function () {
         this.response.speak(STOP_MESSAGE);
         this.emit(':responseReady');
     },
     'AMAZON.StopIntent': function () {
         this.response.speak(STOP_MESSAGE);
         this.emit(':responseReady');
     },
 };

 exports.handler = function (event, context, callback) {
     const alexa = Alexa.handler(event, context, callback);
     alexa.APP_ID = APP_ID;
     alexa.registerHandlers(handlers);
     alexa.execute();
 };

0 个答案:

没有答案