我尝试使用自定义有效负载将Carousel从NODEJS实现发送到Viber客户端。它没有给出任何响应。下面是我的代码:
payload = new Payload(agent.VIBER, {
"type":"rich_media",
"rich_media":{
"Type":"rich_media",
"ButtonsGroupColumns":6,
"ButtonsGroupRows":7,
"BgColor":"#FFFFFF",
"Buttons":[
{
"Columns":6,
"Rows":3,
"ActionType":"open-url",
"ActionBody":"https://www.google.com",
"Image":"http://html-test:8080/myweb/guy/assets/imageRMsmall2.png"
},
{
"Columns":6,
"Rows":2,
"Text":"<font color=#323232><b>Headphones with Microphone, On-ear Wired earphones</b></font><font color=#777777><br>Sound Intone </font><font color=#6fc133>$17.99</font>",
"ActionType":"open-url",
"ActionBody":"https://www.google.com",
"TextSize":"medium",
"TextVAlign":"middle",
"TextHAlign":"left"
},
{
"Columns":6,
"Rows":1,
"ActionType":"reply",
"ActionBody":"https://www.google.com",
"Text":"<font color=#ffffff>Buy</font>",
"TextSize":"large",
"TextVAlign":"middle",
"TextHAlign":"middle",
"Image":"https://s14.postimg.org/4mmt4rw1t/Button.png"
},
{
"Columns":6,
"Rows":1,
"ActionType":"reply",
"ActionBody":"https://www.google.com",
"Text":"<font color=#8367db>MORE DETAILS</font>",
"TextSize":"small",
"TextVAlign":"middle",
"TextHAlign":"middle"
}
]
}
}, { sendAsMessage: true, rawPayload: false }
);
agent.add(payload);我发现的唯一解决办法是从我的实现中使用对Viber消息API的直接API调用。这里解释得很好:https://www.npmjs.com/package/messaging-api-viber
发布于 2020-01-05 18:37:12
目前看来,这是Dialogflow的一个限制。只需使用解决方法:从我的实现中直接调用Viber消息传递API。这里解释得很好:https://www.npmjs.com/package/messaging-api-viber
https://stackoverflow.com/questions/59598996
复制相似问题