from vk_api.longpoll import VkLongPoll, VkEventType
import requests
import vk_api
vk_session = vk_api.VkApi(token='токен')
longpoll = VkLongPoll(vk_session)
vk = vk_session.get_api()
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
if event.text.lower() == 'реф':
if event.ref == "тут ид нужного человека":
vk.messages.send(
user_id=event.user_id,
message='Ваш текст'
)