TypeError: Cannot read properties of undefined (reading 'status')
Why this code stopped working?
11 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Users don't have presence, members do, no need to put
m.user
just do m.presence.status
Made no difference
Do you have
GuildPresences
intent?Yes I do
Shows the same error?
Yes
This is my client
We highly recommend only specifying the intents you actually need.
• Note, that
98303
, 32767
or whatever other magic number you read that represents "all intents", gets outdated as soon as new intents are introduced.
• The number will always represent the same set of intents, and will not include new ones. There is no magic "all intents" bit.Here, I changed it and it didn't make any change at all
Are you there? @Danial
None of these fixed it:
Nevermind
It was giving error because some members' presence was null.
I fixed it with checking if the presence is not null: