简体   繁体   中英

Viber Node.JS Bot API - RichMediaMessage object - doesn't work

Without min api version -

const message = new RichMediaMessage(SAMPLE_RICH_MEDIA);

With min api version -

const message = new RichMediaMessage(SAMPLE_RICH_MEDIA, null, [], undefined, undefined, null, 7);

Both doesn't work while sending

response.send(message);

The error log is like below在此处输入图片说明

Normal text message works well

const message = new TextMessage('hi');

response.send(message);

在此处输入图片说明

I have found the issue.
In their api documentation,
https://developers.viber.com/docs/api/nodejs-bot-api/#RichMediaMessage

"ButtonsGroupRows": 2 (this should be => 4+1=5)

Changing "2" to "5" solved it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM