Answer the question
In order to leave comments, you need to log in
What to do if the bot for vk in python does not see the conversation?
Here is the part of the code responsible for the conversations, everything else works correctly
def send_msg_chat(cht_id, msg):
rand_id = random.randint(100000000, 999999999)
vk.messages.send(
chat_id = cht_id,
message = msg,
random_id = rand_id)
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
print('Вам новое сообщение от id' + str(event.user_id) + ': ' + event.text)
msg = event.text.lower()
if event.from_chat:
print("1")
if msg == 'привет, саня' or 'привет саня':
send_msg_chat(event.chat_id, 'Привет, чатик')
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