首页 文章

在Google NodeJS library v2上的Actions中获取所选的选项键

提问于
浏览
0

我对Google智能助理的操作会向用户显示使用 Carousel 的选项列表 . 旋转木马中显示的每个项目都有一个选项键 .

在Google NodeJS SDK上的操作的第1版中,我使用 app.getSelectedOption() 来访问处理选项选择的intent中所选选项的键 .

如何在v2中访问此密钥?

1 回答

  • 0

    source code of the new SDK找到了答案 .

    处理函数的第三个参数是选项键:

    app.intent('Get Option', (conv, input, option) => {
      console.log(option) // This will log the key
    }
    

相关问题