Answer the question
In order to leave comments, you need to log in
How to get the last message of a user?
Is there a way to get the user's last message in a conversation? I want to make a delete command, but I don't know how to determine the id of the messages that need to be deleted. I use the VK API and the vk-io library (3.2.0, because I can't get the new one to work -_-). I have my own token, I have access.
Answer the question
In order to leave comments, you need to log in
As far as I know, it is impossible to get the last message of the user, as an option to store somewhere the ID of the last message with the date.
Using the method messages.getHistory
, you can get a list of messages in a chat/dialog, and if specified count=1
, you can get the last message.
VK Docs
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question