有没有办法检索由Dialogflow实现Webhook设置的路径参数? 我正在Google Cloud Function中使用Node.js Google-Actions SDK。
我的webhook URL是这样的:https://europe-myexample.cloudfunctions.net/actionHandler/v1
我需要获取v1
参数才能在manageWelcomeIntent
函数中使用它。
const NLGService = require('./services/NLGService.js');
const {dialogflow} = require('actions-on-google');
const app = dialogflow();
exports.actionHandler = app;
app.intent('welcome_intent', NLGService.manageWelcomeIntent);
答案 0 :(得分:1)
例如采用
const url = require('url');
,或更简单的req.url
找出服务器网址,然后提取参数?