【发布时间】:2018-08-13 15:01:27
【问题描述】:
我正在研究 Alexa 技能。目前,我正在尝试获取用户名并将其作为会话变量。但是,每当我去测试它时,它都会给我这个错误:
"errorMessage": "RequestId: 98b4fce1-9699-11e7-a585-43e1799b56fe Process
exited before completing request"
这是日志中的TypeError:
TypeError: Cannot read property 'slots' of undefined
这是我的代码:
exports.handler = function(event, context, callback) {
var alexa = Alexa.handler(event, context);
alexa.APP_ID = APP_ID;
alexa.registerHandlers(handlers);
alexa.dynamoDBTableName = 'usersName';
alexa.execute();
};
var handlers = {
'LaunchRequest': function () {
this.emit('LaunchIntent');
},
'LaunchIntent': function () {
this.atttributes['myName'] = this.event.request.intent.slots.myName.value
this.emit(':ask', 'Hi! Welcome to Welcoming Alarm! What is your name?');
},
'RemebmberNameIntent': function () {
this.emit(':tell,', 'Hi there!' + this.atttributes['myName']);
},
【问题讨论】:
标签: node.js amazon-web-services aws-lambda alexa alexa-skills-kit