有没有办法检索由Dialogflow实现webhook设置的路径参数? 我在Google Cloud Function中使用Node.js actions-on-google SDK。
我的网络钩子网址是这样的: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);
你不能例如使用const url = require('url');
,或者更简单地说,req.url
用于查找您的服务器 URL 然后提取参数?