Cannot read properties of null
Hi,
I am experiencing the following problem when I want to get the status of a server member. Why is it always null?
8 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPconst onlineStaff = interaction.guild.members.cache.filter(member => member.presence.status !== 'offline')
Not all members have a presence
Use nullish coalescing
but in the server we are me and some bots, all in "online"
and do you have tje GuildPresences intent
what? 😅
you need the intent
thanks you