Answer the question
In order to leave comments, you need to log in
How to check for payload in vk api keyboard?
How to check the contents of payload in vk api if my Payload is: "payload": "{\"button\": \"3\"}"
I do everything on Node JS
Answer the question
In order to leave comments, you need to log in
const pld = {"payload":"{\"button\": \"3\"}"};
const payloadObj = JSON.parse(pld.payload); // преобразуем строку в объект
if (Number(payloadObj.button) === 3) {
// тут выполняете нужный код
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question