mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 06:43:17 +00:00
c8e7d7476f
This reverts commit eceb55edff
.
23 lines
969 B
JavaScript
23 lines
969 B
JavaScript
module.exports = {
|
|
name: 'ready',
|
|
async execute(client, dbl) {
|
|
const remoteMusixGuildsData = await client.funcs.dbget('guilds', null, client);
|
|
remoteMusixGuildsData.forEach(guildData => {
|
|
client.global.db.guilds[guildData.id] = guildData.d;
|
|
});
|
|
console.log('- DB Set -');
|
|
client.user.setActivity(`@musix help | 🎶`, { type: 'LISTENING' });
|
|
client.user.setStatus('dnd');
|
|
console.log('- Activated -');
|
|
setInterval(async () => {
|
|
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,
|
|
});
|
|
});
|
|
dbl.postStats(client.guilds.size);
|
|
}, 1200000);
|
|
}
|
|
} |