#anyone help about this error

49 messages · Page 1 of 1 (latest)

loud cosmos
#

• 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.

spring gull
#
  1. You need presence intent if you don't have it already
  2. If you do have it, offline members don't have presence.
loud cosmos
#

i already have the presence intent what do i do?

spring gull
#

I have a second point

loud cosmos
#

huh

spring gull
#
  1. If you do ...
loud cosmos
#

what does 2 mena like if they dont have it?

#

mean*

spring gull
#

their presence is null if they are offline

loud cosmos
#

so what do i do to fix it?

sudden thunderBOT
#

Documentation suggestion for @loud cosmos:
mdn 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.

spring gull
#

use this

loud cosmos
#

what do i do with it???

spring gull
#

use it

loud cosmos
#

yeah how?

spring gull
#

by implementing it into your code

loud cosmos
#

do i press null and paste my code

spring gull
#

wot

loud cosmos
#

wait

#

nvm

#

i run it and it said require not definded?

spring gull
#

where in the world did you get require from

loud cosmos
#

IDK LAMAW

#

should i show yuo the code?

#

im trying to make a welcome embed

spring gull
#

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

loud cosmos
#

wait can you use this text and do what you mean
{name: 'Presence', value: ${member.presence.status}, inline: true}

spring gull
#

no

#

I'm not spoon feeding you

#

I already basically did tbh

loud cosmos
#

is spoon feeding even bad?

#

i just need help FeelsBadMan

spring gull
#

Which I gave you

spring gull
loud cosmos
#

{name: 'Presence', value: ${member.presence?.status}, inline: true},
like that 😄....

spring gull
#

try it and see

sudden thunderBOT
#

mdn 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.

loud cosmos
#

im not good at understand skmdfksdfk\

#

ok so i runed it and tested it