2019-09-15 06:18:33 +00:00
|
|
|
module.exports = {
|
|
|
|
name: 'ready',
|
2019-10-10 13:43:04 +00:00
|
|
|
async execute(client, dbl) {
|
2019-09-15 06:18:33 +00:00
|
|
|
const remoteMusixGuildsData = await client.funcs.dbget('guilds', null, client);
|
|
|
|
remoteMusixGuildsData.forEach(guildData => {
|
2019-10-11 08:48:50 +00:00
|
|
|
client.global.db.guilds[guildData.id] = guildData.d;
|
2019-09-15 06:18:33 +00:00
|
|
|
});
|
2019-10-10 13:43:04 +00:00
|
|
|
console.log('- DB Set -');
|
|
|
|
client.user.setActivity(`@musix help | 🎶`, { type: 'LISTENING' });
|
|
|
|
client.user.setStatus('dnd');
|
|
|
|
console.log('- Activated -');
|
2019-09-15 06:18:33 +00:00
|
|
|
setInterval(async () => {
|
|
|
|
client.guilds.forEach(guild => {
|
2019-10-11 15:50:22 +00:00
|
|
|
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,
|
|
|
|
});
|
2019-09-15 06:18:33 +00:00
|
|
|
});
|
2019-10-11 08:48:50 +00:00
|
|
|
dbl.postStats(client.guilds.size);
|
2019-09-15 06:18:33 +00:00
|
|
|
}, 1200000);
|
|
|
|
}
|
|
|
|
}
|