var str = "Я очень люблю кушать мельмешки, если тоже - заходи ко мне pornhub.com"
var reg = new RegExp("([a-zA-Z0-9]+://)?([a-zA-Z0-9_]+:[a-zA-Z0-9_]+@)?([a-zA-Z0-9.-]+\\.[A-Za-z]{2,4})(:[0-9]+)?([^ ])+",'g');
var result = str.match(reg)
var a = [
{"id":1,"name": "Anton","lastname": "Romanov","rank": "admin","online":"Не распознано"},
{"id":2,"name":"Andrey","lastname": "Ivanov","rank":"admin","online":"Не распознано"},
{"id":3,"name": "Vasya","lastname": "Antonov","rank":"admin","online":"Не распознано"},
{"id":4,"name":"Ivan","lastname": "Andreev","rank": "admin","online":"Не распознано"},
{"id":5,"name":"Ivan","lastname": "Vasiliv", "rank":"player","online":"Не распознано"}
];
var b = [
{'first_name': 'Vasya','id': 3,'can_access_closed': true,'is_closed': false,'online': 0},
{'first_name': 'Andrey','id': 2,'can_access_closed': true,'is_closed': false,'online': 0},
{'first_name': 'Ivan','id': 5,'can_access_closed': true,'is_closed': false,'online': 1}
];
b.forEach(user=>{
a.find(users=>users.id == user.id).online = user.online
})
const admins = data
.filter(n => n.rank === 'admin')
.reduce((acc, n) => {
acc += `${n.name} ${n.lastname}, `;
return acc;
}, '').trim().replace(/,$/, '.');
let lastOnlinePlayers
util.status('test')
.then((response) => {
if (response.onlinePlayers === lastOnlinePlayers) return;
lastOnlinePlayers = response.onlinePlayers
if (response.onlinePlayers > botOnlineMatch.maxOnline) {
botOnlineMatch.maxOnline = response.onlinePlayers
}
if (response.onlinePlayers > botOnlineMatch.dayOnline) {
botOnlineMatch.dayOnline = response.onlinePlayers
}
})
const fs = require('fs');
fs.writeFile('./my.json', '[]', error => console.log("Done!"));
vk.updates.hear(/(?:вопрос)/iu, msg => {
msg.send(`ответ`, {
reply_to: msg.id
});
return;
})
vk.updates.hear(/(?:вопрос)/iu, msg => {
msg.send(`ответ`, {
forward: JSON.stringify({
peer_id: msg.peerId,
conversation_message_ids: [msg.conversationMessageId],
is_reply: 1,
})
});
return;
})