簡體   English   中英

使用 Google 上的操作 SDK 獲取 Dialogflow webhook 路徑參數

[英]Getting Dialogflow webhook path parameters using Actions On Google SDK

有沒有辦法檢索由 Dialogflow 實現 webhook 設置的路徑參數? 我在 Google Cloud Function 中使用 Node.js actions-on-google SDK。

我的 webhook URL 是這樣的: https://europe-myexample.cloudfunctions.net/actionHandler/v1

我需要獲取v1參數才能在manageWelcomeIntent function 中使用它。

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 然后提取參數?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM