#anyone help about this error
49 messages · Page 1 of 1 (latest)
• 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.
- You need presence intent if you don't have it already
- If you do have it, offline members don't have presence.
i already have the presence intent what do i do?
I have a second point
huh
I have a second point
- If you do ...
their presence is null if they are offline
so what do i do to fix it?
Documentation suggestion for @loud cosmos:
Optional chaining (?.)
The optional chaining operator (?.) accesses an object's property or calls a function. If the object is undefined or null, it returns undefined instead of throwing an error.
use this
what do i do with it???
use it
yeah how?
by implementing it into your code
do i press null and paste my code
wot
no
You just add a single question mark
after presence
optional chaining
then you could use nullish coalescing operator (??) to set a default value
like offline
wait can you use this text and do what you mean
{name: 'Presence', value: ${member.presence.status}, inline: true}
Which I gave you
...
{name: 'Presence', value: ${member.presence?.status}, inline: true},
like that 😄....
try it and see
Also this
i dont get about this
Nullish coalescing operator (??)
The nullish coalescing operator (??) is a logical operator that returns its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side operand.

