N
N
Nameless Man2020-06-25 11:01:05
JavaScript
Nameless Man, 2020-06-25 11:01:05

How to catch post edit event via VK API?

Hello! For the sake of pleasure, I am writing a bot on the VK-IO (JS) library, I would like to know how to catch the message editing event (like in the console it says: "Message edited to: *new text after editing*"), if my bot is a page bot( not a group) I tried to do it myself, it just didn't want to work. I wanted to ask you for help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yamudaqq, 2020-06-25
@Almas_Almuhametov

to implement this, you need to constantly check all previous messages that have ever been sent to the bot page.
First you need to find out all their IDs.
after that, use the messages.getById method and check if it contains 'update_time', as in the picture,
b4XZpnp7Tr_eZ1Hj-NFfRQ.jpeg
if it is, then the message was edited. you pull out the text from it and output it to the console. all complexity in check of all previous messages.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question