Answer the question
In order to leave comments, you need to log in
How to make it so that the report in the VK bot is sent to all admins in the bot?
There is no way I can make the bot send all the admins about the report. Tell me the code please.
Answer the question
In order to leave comments, you need to log in
If the report was written in a conversation
import vk_api
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
vk_session = vk_api.VkApi(token='токен бота')
vk = vk_session.get_api()
longpoll = VkBotLongPoll(vk_session, id группы-бота)
while True:
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
if event.object.peer_id != event.object.from_id:
if event.object.text.lower() == 'репорт':
vk.messages.send(peer_id=event.object.peer_id, message='Введите свой репорт', random_id=0)
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
if event.object.peer_id != event.object.from_id:
vk.messages.send(peer_id=event.object.peer_id, message='Спасибо за репорт! Я отправлю его нашим админам', random_id=0)
vk.messages.send(user_id=id админа, message='Репорт от пользователя:\n' + str(event.object.text.lower()), random_id=0)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question