util.status('test')
.then((response) => {
if (response.onlinePlayers > botOnlineMatch.maxOnline) {
botOnlineMatch.maxOnline = response.onlinePlayers
}
if (response.onlinePlayers > botOnlineMatch.dayOnline) {
botOnlineMatch.dayOnline = response.onlinePlayers
}
})
response.onlinePlayers
, только в том случае выполнялась часть кода? 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
}
})