【发布时间】:2020-12-29 15:52:53
【问题描述】:
我已将 Dialogflow 代理连接到 Facebook 页面,并且我正在使用 Dialogflow 中的履行功能显示 Facebook 卡响应。我不知道如何捕捉卡片按钮点击事件。我需要聊天移动到按钮点击的下一个意图。但是按钮点击不会触发任何事情。
这是用于创建按钮的实现代码
function getState(agent){
state = agent.parameters.State;
return getAd()
.then(result => {
for(const item of result.result){
agent.add(new Card({
title: item.nmi,
imageUrl: 'url',
text: item.structuredAddress.singleAddressLine,
buttonText: item.nmi,
buttonUrl: 'uri'
})
);
}
})
.catch(() => {
agent.add(`I'm sorry.`);
});
}`
【问题讨论】:
标签: dialogflow-es dialogflow-es-fulfillment