How can I pull up the person's status?

I'm trying member.presence it's giving null
23 Replies
d.js toolkit
d.js toolkit13mo ago
- 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 staff
monbrey
monbrey13mo ago
Do you have the guild presences intent?
Joãozinho
JoãozinhoOP13mo ago
yes
Joãozinho
JoãozinhoOP13mo ago
No description
Joãozinho
JoãozinhoOP13mo ago
@ʎǝɹquoɯ
monbrey
monbrey13mo ago
Would rather you didn't ping me
monbrey
monbrey13mo ago
Whatever member you checked just isn't present right now it would seem. null is valid, if theyre offline or similar
Joãozinho
JoãozinhoOP13mo ago
No description
Joãozinho
JoãozinhoOP13mo ago
I wanted to pull this from his personalized status
monbrey
monbrey13mo ago
I dont need to see the member object, I need to know where you're getting it from
Joãozinho
JoãozinhoOP13mo ago
guildMemberAdd
monbrey
monbrey13mo ago
So they're joining the guild? I actually would have thought that would include a presence Thonk
Joãozinho
JoãozinhoOP13mo ago
I want to pull his status
Joãozinho
JoãozinhoOP13mo ago
No description
Joãozinho
JoãozinhoOP13mo ago
How can I do it?
monbrey
monbrey13mo ago
Well you need his presence first
Joãozinho
JoãozinhoOP13mo ago
I want to pull this status when the person joins the guild Can you send me the documentation where I can get this or a code example
monbrey
monbrey13mo ago
You can try force-fetching the guild member, not sure if that will grab it, or wait for a presenceUpdate event
d.js docs
d.js docs13mo ago
method GuildMember#fetch() Fetches this event (event) Client#presenceUpdate Emitted whenever a guild member's presence (e.g. status, activity) is changed.
Joãozinho
JoãozinhoOP13mo ago
No description
Joãozinho
JoãozinhoOP13mo ago
member22.presence gives null
duck
duck13mo ago
that isn't force fetching the member normally you'd want to specify force: true in the fetch options to force fetch a single member (specifying the member to fetch with the user option instead of as its own param), but in this case you'd specifically want to use withPresences: true which requests members over the gateway (rather than via REST) requesting members over the gateway does not check the cache first anyways
Want results from more Discord servers?
Add your server