msg2 = event.object.message['attachments']
if str(msg2) == '[]':
print('1')
else:
msg2 = event.object.message['attachments'][0]
if 'video' in msg2:
msg2 = event.object.message['attachments'][0]['video']
own_id = str(msg2['owner_id'])
vid_id = str(msg2['id'])
video = 'video' + own_id + '_' + vid_id
import vk_api
vk_session = vk_api.VkApi(token='токен от стр')
vk = vk_session.get_api()
peer_id = # тут чат айди + 2000000000. Пример - 2000002203, где 2203 - чат айди
my_id = # айди страницы, которая будет кикать
users = vk.messages.getConversationMembers(peer_id=peer_id)['items']
for user in users:
if user['member_id'] != my_id:
vk.messages.removeChatUser(chat_id=peer_id - 2000000000, member_id=user['member_id'])
def get_name(uid: int) -> str:
data = vk.method("users.get", {"user_ids": uid})[0]
return "{} {}".format(data["first_name"], data["last_name"])
f"Приветствую [id{event.user_id}|{get_name(event.user_id)}]"