1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 00:23:17 +00:00

Update ready.js

This commit is contained in:
MatteZ02 2019-11-05 19:28:03 +02:00
parent c2490b94ed
commit 67bc85b47e

View File

@ -17,22 +17,22 @@ module.exports = {
let users = 0; let users = 0;
client.guilds.forEach(guild => { client.guilds.forEach(guild => {
users += guild.memberCount; users += guild.memberCount;
}) });
let status = [`${users} users on ${client.guilds.size} guilds!`, `@${client.user.username} help | 🎶`]; let status = [`${users} users on ${client.guilds.size} guilds!`, `@${client.user.username} help | 🎶`];
let i = 0; let i = 0;
setInterval(() => { setInterval(() => {
if (i == status.length) { if (i == status.length) {
i = 0; 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' }); client.user.setActivity(status[i], { type: 'LISTENING' });
i++; i++;
users = 0; users = 0;
client.guilds.forEach(guild => {
users += guild.memberCount;
})
}, 30000); }, 30000);
setInterval(async () => { setInterval(async () => {
client.guilds.forEach(guild => {
client.db.collection('guilds').doc(guild.id).set({ client.db.collection('guilds').doc(guild.id).set({
prefix: client.global.db.guilds[guild.id].prefix, prefix: client.global.db.guilds[guild.id].prefix,
defaultVolume: client.global.db.guilds[guild.id].defaultVolume, defaultVolume: client.global.db.guilds[guild.id].defaultVolume,
@ -48,7 +48,6 @@ module.exports = {
saved: client.global.db.playlists[guild.id].saved, saved: client.global.db.playlists[guild.id].saved,
}); });
} }
});
dbl.postStats(client.guilds.size); dbl.postStats(client.guilds.size);
}, 1800000); }, 1800000);
} }