Alexa lambda函数默认为未处理?

问题描述 投票:0回答:1

下面是我的Alexa lambda函数的代码,删除了我的所有数据和其他意图。我遇到的问题是我的lambda函数似乎没有启动,我不断得到输出,“抱歉,我不知道该怎么做”意味着它将进入未处理的函数。有人可以建议吗?

var Alexa = require('alexa-sdk');
const APP_ID = 'amzn1.ask.skill.353021cb-577e-4cfc-9edd-b440e6f095fe';

var handlers = {
   'LaunchRequest': function() {
    this.emit(':tell', 'I can help you pick your tie. Tell me the color of your outfit, pattern of your shirt, or pattern of your tie.','Tell me the color of your outfit, pattern of your shirt, or pattern of your tie.');

    },
'Unhandled': function() {
    this.emit(':tell','Sorry, I don\'t know what to do');

    },
    };

exports.handler = function(event,context){
    var alexa = Alexa.handler(event,context);
    alexa.registerHandlers(handlers);
    alexa.execute();
};
aws-lambda launch alexa alexa-skills-kit unhandled-exception
1个回答
1
投票

你是如何测试你的技能的?如果你使用('旧')服务模拟器测试它,你不会得到LaunchRequest类型的请求,但是你的交互模型具有最佳匹配意图的IntentRequest - 就像你用意图调用你的技能一样比如'Alexa,请领带选择器挑选领带'。

如果你想要这样的“深度”调用来触发你的第一个处理程序,你可以用LaunchRequest替换NewSession

希望有所帮助!

© www.soinside.com 2019 - 2024. All rights reserved.