Ошибка Login is required to auth в pythone 3.8
Вот код:
import vk_api
import requests
import time
token='тут токен'
session = requests.Session()
vk_session = vk_api.VkApi(token=token)
try:
vk_session.auth(token_only=True)
except vk_api.AuthError as error_msg:
print(error_msg)
from vk_api.longpoll import VkLongPoll, VkEventType
longpoll = VkLongPoll(vk_session)
vk = vk_session.get_api()
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW and event.text:
if event.from_chat:
time.sleep(1800)
vk.messages.send(
chat_id=event.chat_id,
message='общий сбор'
)
Помогите пж решить проблему
20 апреля 2020 в 20:09