Answer the question
In order to leave comments, you need to log in
What is the problem with the vk_api bot?
The bot does not respond and writes to the KeyboardInterrupt console (Longpoll 5.90)
import vk_api
from vk_api.utils import get_random_id
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
vk_session = vk_api.VkApi(token="token")
vk = vk_session.get_api()
longpoll = VkBotLongPoll(vk_session, "198104184")
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
if event.obj.text == 'тест':
if event.from_chat:
vk.messages.send(
random_id=get_random_id(),
peer_id=event.obj.peer_id,
message="bruh")
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