client.guilds foreach
this.bot.once('ready', () => {
if (!this.bot.user.avatarURL) { // avatarURL == null if not set
this.bot.user.setAvatar(fs.readFileSync('./idle-rpg/res/hal.jpg'));
}
this.bot.user.setStatus('idle');
this.discord.loadGuilds();
this.loadHeartBeat();
this.Crons.loadCrons();
this.bot.guilds.forEach(async (guild) => {
this.Game.loadGuildConfig(guild.id);
guild.members
.filter(member => !member.user.bot && member.presence.status !== 'offline' && this.Game.dbClass().shouldBeInList(member.id, member.guild.id))
.map(member => Object.assign({}, {
name: member.nickname ? member.nickname : member.displayName,
discordId: member.id,
guildId: guild.id,
}))
.forEach(member => this.onlinePlayers.set(member.discordId + member.guildId, member));
}, console.log('Reset all personal multipliers'));
});