import vk_api, random
vk_session = vk_api.VkApi(token="3a8f26eddf6e7a4ef2ef0243bc0fb47155bed55bcd3c5af7d4a89e2a8b940e88a63539531541706209ba0")
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
longpoll = (vk_session)
vk = vk_session.get_api()
global Random
def random_id():
Random = 0
Random += random.randint(0, 10000000)
return Random
while True:
for event in longpoll.listen():
if event.type == VkBotEventType.MESSEAGE_NEW and event.to_me:
if event.text.lowar() == "1":
vk.messages.send(
user_id=event.user_id,
massege="2!",
random_id=random_id()
)
А вот ошибка:
raceback (most recent call last):
File "C:/Users/1/PycharmProjects/BOT/BOT.py", line 20, in
for event in longpoll.listen():
AttributeError: 'VkApi' object has no attribute 'listen'
Не пойму что не так, помогите пожалуйста(