программа:
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
import vk_api
vk = vk_api.VkApi(token="")
vk._auth_token()
vk.get_api()
longpoll = VkBotLongPoll(vk,199356250)
while True:
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
if event.object.peer_id != event.object.from_id:
if event.object.text.lower() == "привет":
vk.method("messages.send", {"peer_id": event.object.peer_id, "message": event.object.text,
"random_id": 0})
elif event.object.peer_id == event.object.from_id:
if event.object.text.lower() == "привет":
vk.method("messages.send", {"user_id": event.object.from_id, "message": event.object.text,
"random_id": 0})
ошибка:
Traceback (most recent call last):
File "C:\Users\Александр\Desktop\бот.py", line 1, in <module>
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
File "C:\Users\Александр\Desktop\vk_api.py", line 4, in <module>
vk = vk_api.VkApi(token=token)
AttributeError: partially initialized module 'vk_api' has no attribute 'VkApi' (most likely due to a circular import)