G
G
German Shestak2018-09-19 17:15:51
In contact with
German Shestak, 2018-09-19 17:15:51

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

2 answer(s)
V
Vladlen Hellsite, 2018-09-20
@ilovetwilight

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.

K
Kirill Kudryavtsev, 2018-09-20
@Deissh

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 question

Ask a Question

731 491 924 answers to any question