import vk_api
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
from vk_api.utils import get_random_id
vk_session = vk_api.VkApi(token='your_group_token')
vk = vk_session.get_api()
longpoll = VkBotLongPoll(vk_session, 'your_group_id')
for event in longpoll.listen():
msg = event.text.lower()
if msg == 'привет':
if event.type == VkBotEventType.MESSAGE_NEW:
vk.messages.send(
user_id=event.chat_id,
random_id=get_random_id(),
message='Мяу-привет'
)
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW and event.object.text.lower() == 'привет':
peerID = event.object.peer_id
send('Привет')
if "!админ" in text and 1+1 == 2:
admins.append(int(text.replace('!админ', '')))
for event in longpool.listen():