diff --git a/index.js b/index.js index 270735b..8629d1a 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,6 @@ function sendOnline(status, channel) { embed.addField("**" + status[s].name + "**:", status[s].players.join(', '), false); } }; - if ( playerCount == 0 ) return; embed.setTitle("**Players Currently Online:** " + playerCount); channel.send(embed); } @@ -57,6 +56,7 @@ client.on('message', async msg => { } }); Servers.forEach(function (server) { + if ( !status[server.slug] ) return; const q = new Query({host: server.rconAddress, port: server.queryPort, timeout: 250}); try { q.fullStat() @@ -69,6 +69,8 @@ client.on('message', async msg => { .then(() => { q.close(); }) .catch(e => { q.close(); + console.log("slug: " + server.slug); + console.log(status); status[server.slug].tested = true; sendOnline(status, msg.channel); });