Cannot read property 'cache' of undefined

i am trying to change nickname of available users in the server if they are also available in the database, but Iā€™m getting undefined cache error, :frowning:

    let members = guild.members.cache.filter(function(member){ return member.user.bot === false && member.user.id != member.guild.ownerID })
                  .map(function(member){ return {id: member.user.id, nickname: member.nickname, member: member} });

add message. before guild

1 Like