P
P
p1ugg2020-09-22 18:51:46
Python
p1ugg, 2020-09-22 18:51:46

How to track like or comment of vk_api user?

How to track like user vk_api?
For example, a person likes or comments on the last post, how can I find out the ID of this user?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
drikor, 2020-09-25
@drikor

import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType

token = "токен"
vk = vk_api.VkApi(token=token)

session_api = vk.get_api()
longpoll = VkLongPoll(vk)

for event in longpoll.listen():
    if event.type == VkEventType.LIKE_ADD:
         print(f'Новый лайк от {event.liker_id}')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question