[英]How to map multiple intents to one handler in dialogflow-fulfillment?
There are multiple intents in my bot that can use a single handler.我的机器人中有多个可以使用单个处理程序的意图。
In v1, this was done by在 v1 中,这是由
function handler (agent){
//handler code
}
let intentMap = new Map();
intentMap.set('Intent1', handler);
intentMap.set('Intent2', handler);
How can the same be achieved in v2?如何在 v2 中实现相同的功能?
Thanks in advance提前致谢
I found one way to do this我找到了一种方法来做到这一点
app.intent('Intent1', (conv) => {
//handler code
});
app.intent('Intent2', 'Intent1');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.