Answer the question
In order to leave comments, you need to log in
How to make the bot respond to all messages?
I wrote a bot and I don’t understand how to make it respond to all messages
def sender(id, text):
vk_session.method('messages.send', {'chat_id': id, 'message': text, 'random_id' : 0})
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
if event.to_me:
if event.from_chat:
msg = event.text.lower()
id = event.chat_id
if msg == '1':
sender(id, '1')
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