1// First we use guild.members.fetch to make sure all members are cached
2<message>.guild.members.fetch().then(fetchedMembers => {
3 const totalOnline = fetchedMembers.filter(member => member.presence.status === 'online');
4 // We now have a collection with all online member objects in the totalOnline variable
5 <message>.channel.send(`There are currently ${totalOnline.size} members online in this guild!`);
6});
7