I am trying to loop through all of the members in my server and show each of their playing/game messages. This code is in the message event handler:
var members = message.guild.members.map(m => user.presence.game.name);
console.log(members);
When I run this however, I get the following error:
var members = message.guild.members.map(m => user.presence.game.name);
^
TypeError: Cannot read property 'name' of null
I cannot figure out how to handle a null playing status, I even tried a filter but that did not work.
Thanks in advance.