Answer the question
In order to leave comments, you need to log in
How to process Payload in VK Bot?
cmd.hear(/^(?:Начать)$/i, async message => {
vk.api.call('messages.send', {
user_id: message.senderId,
random_id: 0,
message: `Вы находитесь в Главном меню`,
keyboard: JSON.stringify(
{
"one_time": false,
"inline": false,
"buttons": [
[{
"action": {
"type": "text",
"payload": "{\"button\": \"1\"}",
"label": 'FAQ'
},
"color": 'positive'
}]
]
})
})
});
Answer the question
In order to leave comments, you need to log in
vk.updates.on('new_message', (ctx) => {
if (ctx.messagePayload.button == 1) {
// ...
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question