The Viber bot NodeJS library provides just what you need to develop intelligent bots that interact naturally with your Viber users
user1402 on master
Add reject handler to bot sendM… Merge pull request #13 from dis… (compare)
Hello everybody. I have a small problem sending messages with the keyboard.
Bug reproduction:
Expected:
User will see 2 messages, keyboard will not show
Received:
User receives 2 messages + keyboard from the first message
Reproduced only on Anroid, with the network turned off. If not disabled, the keyboard is not shown
On IOS is not reproduced at all
https://website.com
;Good Day I have a noob question. I'm using nestjs and viber restAPI
I want to validate the request where it came from so I did this.
createHmac("sha256", this.VIBER_TOKEN)
.update(Buffer.from(JSON.stringify(req.body), 'utf-8').toString())
.digest("hex");
Then when the result is not equal to the x-viber-content-signature
, any idea on this?
btw i also tried the data example from viber api https://developers.viber.com/docs/api/rest-bot-api/
const crypto = require('crypto');
const token = '4453b6ac12345678-e02c5f12174805f9-daec9cbb5448c51f';
const json = {
"event":"delivered",
"timestamp":1457764197627,
"message_token":491266184665523145,
"user_id":"01234567890A="
}
const hash = crypto.createHmac("SHA256", token)
.update(JSON.stringify(json))
.digest("hex");
console.log(hash);
// RESULT:
// e8ef38af7664e30ea1ea1d883b6122d6a104bb7c53fefdf9dff74c3d7eb4a33d
But in the api it suppose to be this
9d3941b33d45c165400d84dba9328ee0b687a5a18b347617091be0a56d