Answer the question
In order to leave comments, you need to log in
How to find out the last message sent to a specific user from a VK group?
Good afternoon.
It is necessary to implement the menu using callback buttons.
The principle is simple:
The user starts a chat with the bot. The community sends him a keyboard with the Callback button of a certain Payload. After pressing the Callback button, the bot edits the message and sends a new keyboard with Callback buttons. For this I need: peer_id and conversation_message_id. If I can get the peer_id from the message_event, then I can only get the conversation_message_id when the message itself is sent, and not when the callback button is pressed.
Question: How to track the last message sent to a specific user in the correspondence of the VK group from vkapi itself? Or do I need to remember peer_id and conversation_message_id on my own.
Answer the question
In order to leave comments, you need to log in
To get the conversation_message_id you just need to create a variable like:
conv = event.obj.message['conversation_message_id']
per = event.object.message['from_id']
if event.from_user:
id = event.object.message['from_id']
if id == 'айди пользователя'
#Код
If I can get the peer_id from the message_event, then I can get the conversation_message_id only when the message itself is sent, and not when the callback button is pressed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question