From 89d010e2e5acefb9fcaa701e52ef59bb820b064b Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Mon, 11 Nov 2019 15:55:32 +0200 Subject: [PATCH] Update ready.js --- events/ready.js | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/events/ready.js b/events/ready.js index aaa2e25c..adfc8980 100644 --- a/events/ready.js +++ b/events/ready.js @@ -14,40 +14,34 @@ module.exports = { client.user.setStatus('dnd'); dbl.postStats(client.guilds.size); console.log('- Activated -'); - let users = 0; - client.guilds.forEach(guild => { - users += guild.memberCount; - }); - let status = [`${users} users on ${client.guilds.size} guilds!`, `@${client.user.username} help | 🎶`]; + let status = [`${client.guilds.size} guilds!`, `@${client.user.username} help | 🎶`]; let i = 0; setInterval(() => { if (i == status.length) { i = 0; } - client.guilds.forEach(guild => { - users += guild.memberCount; - }); - status = [`${users} users on ${client.guilds.size} guilds!`, `@${client.user.username} help | 🎶`]; client.user.setActivity(status[i], { type: 'LISTENING' }); i++; users = 0; }, 30000); setInterval(async () => { - client.db.collection('guilds').doc(guild.id).set({ - prefix: client.global.db.guilds[guild.id].prefix, - defaultVolume: client.global.db.guilds[guild.id].defaultVolume, - permissions: client.global.db.guilds[guild.id].permissions, - premium: client.global.db.guilds[guild.id].premium, - dj: client.global.db.guilds[guild.id].dj, - djrole: client.global.db.guilds[guild.id].djrole, - startPlaying: client.global.db.guilds[guild.id].startPlaying - }); - if (client.global.db.guilds[guild.id].premium) { - client.db.collection('playlists').doc(guild.id).set({ - songs: client.global.db.playlists[guild.id].songs, - saved: client.global.db.playlists[guild.id].saved, + client.guilds.forEach(guild => { + client.db.collection('guilds').doc(guild.id).set({ + prefix: client.global.db.guilds[guild.id].prefix, + defaultVolume: client.global.db.guilds[guild.id].defaultVolume, + permissions: client.global.db.guilds[guild.id].permissions, + premium: client.global.db.guilds[guild.id].premium, + dj: client.global.db.guilds[guild.id].dj, + djrole: client.global.db.guilds[guild.id].djrole, + startPlaying: client.global.db.guilds[guild.id].startPlaying }); - } + if (client.global.db.guilds[guild.id].premium) { + client.db.collection('playlists').doc(guild.id).set({ + songs: client.global.db.playlists[guild.id].songs, + saved: client.global.db.playlists[guild.id].saved, + }); + } + }); dbl.postStats(client.guilds.size); }, 1800000); }