【发布时间】:2018-02-03 18:52:26
【问题描述】:
这几天我一直在努力解决这个问题,它类似于another question,但那个答案并没有解决我的问题。
我无法从我的 Alexa 技能填充 JSON 响应的 sessionAttributes 属性:
var sessionAttributes = {};
sessionAttributes = { "somekey": "somevalue" };
session.attributes = sessionAttributes;
我认为从我的 AWS Lambda 函数发送的响应来自 Alexa 的请求的响应将包含我的自定义添加,但事实并非如此,我不知道为什么。
我想我理解响应对象对于 this.response 访问的闭包是私有的,但这只会让我更加困惑(来源:Github Issue)
所以我的问题是:如何在涉及多个用户与 Alexa 交互的会话中保留数据?
我认为需要构建自己的响应对象,我不能使用任何自动化功能?
【问题讨论】:
-
I thought the response sent from my Lambda function would then include my custom addition but this is not the case, and I can't figure out why.哪个 lambda 函数? -
抱歉,我不想转储代码 - 我正在使用 AWS Lambda 来托管形成此 Alexa 技能的代码,我将在我的帖子中澄清这一点,因为我知道 Lamda 函数和 AWS Lambda 完全不同!
标签: javascript alexa-skills-kit alexa-skill