我对Google助手的操作使用 Carousel 。旋转木马中显示的每个项目都有一个选项键。
Carousel
在我使用的Google NodeJS SDK上的v1操作中 app.getSelectedOption() 在处理选项选择的意图中访问所选选项的键。
app.getSelectedOption()
如何在v2中访问此密钥?
在中找到答案 source code of the new SDK 。
handler函数的第三个参数是选项键:
app.intent('Get Option', (conv, input, option) => { console.log(option) // This will log the key }