guild = client.guilds.cache.get("guildid"); guild.members.fetch().then(fetchedMembers=>{console.log(fetchedMembers.length)})
Using discord.