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

Update ready.js

This commit is contained in:
MatteZ02 2020-02-19 11:24:26 +02:00
parent 8e929f2c1f
commit d4b3304e45

View File

@ -8,7 +8,7 @@ module.exports = {
client.global.db.guilds[guildData.id] = guildData.d; client.global.db.guilds[guildData.id] = guildData.d;
}); });
if (client.devMode) { if (client.devMode) {
client.guilds.forEach(guild => { client.guilds.cache.forEach(guild => {
client.global.db.guilds[guild.id] = { client.global.db.guilds[guild.id] = {
prefix: client.config.prefix, prefix: client.config.prefix,
defaultVolume: client.config.defaultVolume, defaultVolume: client.config.defaultVolume,
@ -33,7 +33,7 @@ module.exports = {
setInterval(async () => { setInterval(async () => {
if (client.config.saveDB && !client.config.devMode) { if (client.config.saveDB && !client.config.devMode) {
console.log('DB saved'); console.log('DB saved');
client.guilds.forEach(guild => { client.guilds.cache.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,