vk.updates.hear(/^(?:!kick)(\s?https\:\/\/vk\.com\/)?(id)?([0-9]+)?([^]+)?/i, (message) => {
let user = users.users[message.user];
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
}
});
let user = users.users[message.user];
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
}
});