Answer the question
In order to leave comments, you need to log in
How to get payload?
For the VKontakte bot in Python, I did not find a way to find out the payload, and if there was, then they sent the buttons json with a scheme or the methods themselves were different.
In one of the videos on YouTube, I heard that payload can only be set in add_callback_button , but that's bad luck, in the ide tips it says that this argument can be set in other buttons as well. How to check if there is a payload, get it and install it.
The code:
session = vk_api.VkApi(token="токен")
longpoll = VkLongPoll(session)
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
if event.to_me:
user_id = event.user_id
message = event.text
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question