Google cloud platform Dialogflow谷歌日历集成“;错误:WebhookClient.HandlerRequest中没有请求意图的处理程序;

Google cloud platform Dialogflow谷歌日历集成“;错误:WebhookClient.HandlerRequest中没有请求意图的处理程序;,google-cloud-platform,google-calendar-api,dialogflow-es,Google Cloud Platform,Google Calendar Api,Dialogflow Es,我在Dialogflow中使用FullFilling进行了Google日历集成。 当我测试这个动作时,我在谷歌云平台中得到了以下错误 Error: No handler for requested intent at WebhookClient.handleRequest (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:317:29) at exports.dialogfl

我在Dialogflow中使用FullFilling进行了Google日历集成。 当我测试这个动作时,我在谷歌云平台中得到了以下错误

Error: No handler for requested intent
    at WebhookClient.handleRequest (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:317:29)
    at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/workspace/index.js:62:8)
    at cloudFunction (/workspace/node_modules/firebase-functions/lib/providers/https.js:57:9)
    at process.nextTick (/layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/invoker.js:100:17)
    at process._tickCallback (internal/process/next_tick.js:61:11)
这是我的云功能代码-使用的意图的名称是“book.appointment”

你知道我做错了什么吗?
提前感谢,Bianca

您必须在以下内容中使用“+”而不是“-”进行拆分:

const dateTimeStart = new Date(Date.parse(agent.parameters.date.split('T')[0] + 'T' + agent.parameters.time.split('T')[1].split('-')[0] + timeZoneOffset));
因为你的时区偏移是“+02:00”

或者尝试将所有这些更改为:

const dateTimeStart = new Date(Date.parse(agent.parameters.date.split('T')[0] + 'T' + agent.parameters.time.split('T')[1]));

 
const dateTimeEnd = new Date(new Date(dateTimeStart).setHours(dateTimeStart.getHours() + 1));
     
const appointmentTimeString = dateTimeStart.toLocaleString(
      'en-US',
      { weekday: 'short', day: 'numeric', month: 'short', hour: 'numeric', minute: 'numeric', timeZone: timeZone }
    );

我希望这能起作用,因为这对我来说确实有效。

欢迎来到StackOverflow。这似乎是个奇怪的问题。如果我们能看到你们认为应该触发的意图的屏幕截图,这会有所帮助。您可能还想记录
请求.body
并发布它,因为它可能会发布一些细节。[1]:[2]:[3]:
const dateTimeStart = new Date(Date.parse(agent.parameters.date.split('T')[0] + 'T' + agent.parameters.time.split('T')[1]));

 
const dateTimeEnd = new Date(new Date(dateTimeStart).setHours(dateTimeStart.getHours() + 1));
     
const appointmentTimeString = dateTimeStart.toLocaleString(
      'en-US',
      { weekday: 'short', day: 'numeric', month: 'short', hour: 'numeric', minute: 'numeric', timeZone: timeZone }
    );