X
X
xopolllu2019-05-12 21:03:21
Python
xopolllu, 2019-05-12 21:03:21

How to handle pressing the bot's keyboard button in the VK API?

How to handle keyboard presses via longpoll? Now I just look at the text of the message and compare it with the button names. Other bots have buttons on the keyboard with the same text, and the bot reacts to them differently. I cannot find this information.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stockholm Syndrome, 2019-05-12
@xopolllu

use the payload property
, for example, for one button, payload will be {"button": "1"}, for the second - {"button": "2"}, while the text of the buttons can be the same .
More details here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question