Home python How to read all messages in the VK conversation with a bot?

How to read all messages in the VK conversation with a bot?




Description : there is a conversation in VK with 3+ interlocutors, a bot from my group has added there; The bot issued all rights, the most actual version of Longpool is selected.

Task : you need to get all the messages that were previously written in conversation. Tell me, please, how can this be implemented? I will be glad any help!

Tried : it was already possible to request information about the conversation using the Method query, {'peer_ids': 2000000000 + ID, 'Unread': 0, 'Filter' : 'all', 'extended': 1}) , but this query does not display information about user messages.

was tested by messages.gethistory , but it does not work because the request occurs in a multiplayer conversation, and not in personal messages of the group.

was still tested by messages.getdialogs , but, as they say in the official documentation VK, that he is outdated and better not to use it.

Answer 1

The problem is that the bots-communities have a correspondence story in the conversations, therefore, all messages id = 0 and the method cannot be called. You can try User-Token, but it requires an appeal to those. VK support

Update . You can collect all messages using the GetMessageByID method

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions