Answer the question
In order to leave comments, you need to log in
How to organize a kick from a conversation?
How to organize a kick from a conversation using a forwarded message?
There is this code
if(msg.peerType != "chat") return send("❌ || Данная команда работает только в беседах!");
if(!msg.forwards) return send("❌ || Не обнаружено пересланного сообщения!");
var g23 = msg.forwards[0];
vk.api.messages.removeChatUser({chat_id: msg.peerId-2000000000, user_id: g23.senderId})
send("⚠Пользователь исключён!");
Answer the question
In order to leave comments, you need to log in
In VK, it is possible not only to forward messages, but also to reply to them.
As a result, vk-io provides a replyMessage object in the new message event.
let removedUser = (msg.replyMessage ? msg.replyMessage.senderId : msg.forwards[0].senderId);
vk.api.messages.removeChatUser({chat_id: msg.chatId, user_id: removedUser});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question