Use Async Functions in DialogFlow WebHook

随声附和 提交于 2019-11-28 00:16:44

You didn't state what environment you were running in, but given your code, and the agent.parameters change I outlined above, I was able to duplicate your problem using Firebase Cloud Functions with node.js 6.14.

I was able to get it to work by using the request-promise-native package instead of request-promise. As the name suggests, this uses native Promises instead of the Bluebird Promise package, but otherwise the calls you're making are identical.

The Promise logic looks sound, but this line doesn't make sense:

let params = request.body.result.parameters;

There is no request object that is in scope.

You can get the parameters for the request from agent.parameters.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!