Answer the question
In order to leave comments, you need to log in
AttributeError: partially initialized module 'http.cookiejar' has no attribute 'CookieJar' (most likely due to a circular import) How to fix?
What's my mistake?
from vk_api.longpoll import VkLongPoll, VkEventType
import vk_api
import data
from datetime import datetime
login, password = 'мой логин', 'мой пароль'
vk_session = vk_api.VkApi(login, password)
vk = vk_session.auth()
session_api = vk_session.get_api()
longpoll = VkLongPoll(vk_session)
while True:
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
print('Текст сообщения: ' + str(event.text))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question