import vk_api
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
vk_session = vk_api.VkApi(token = 'цензура')
longpoll = VkBotLongPoll(vk_session, цензура)
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 == VkBotEventType.MESSAGE_NEW:
if event.from_chat:
id = event.chat_id
msg = event.object.message['text'].lower()
elif msg == 'айди':
sender(id, f'{event.obj.from_id}')