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')