Answer the question
In order to leave comments, you need to log in
Why is the person not kicking?
Hello, I did a kick for the VK bot, but it does not kick. What should I do? And how can I make it possible to kick /kick, and not !kick
vk.updates.hear(/^(?:!kick)(\s?https\:\/\/vk\.com\/)?(id)?([0-9]+)?([^]+)?/i, (message) => {
let user = users.users[message.user];
if(user.admin_level < 1) return;
if(message.$match[4]) {
var domain = message.$match[4].split(" ");
vk.api.call("utils.resolveScreenName", {
screen_name: message.$match[4]
}).then((res) => {
new_user(res.object_id);
if(users.users[res.object_id].admin_level == 2) return message.reply('Отказ');
vk.api.call("messages.removeChatUser", {chat_id: message.chatId, user_id: res.object_id })
.catch((error) => {return message.send(`Error.`);
});
return
})
}else{
if(!message.$match[3]) return message.reply("ID пользователя не указан");
new_user(message.$match[3]);
if(users.users[message.$match[3]].admin_level == 2) return message.reply('Отказ');
vk.api.call("messages.removeChatUser", { chat_id: message.chatId, user_id: message.$match[3] }).
catch((error) => {return message.send(`Error.`);});
return
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question