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 toolkit2y 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
monbrey2y ago
Do you have the guild presences intent?
Joãozinho
JoãozinhoOP2y ago
yes
Joãozinho
JoãozinhoOP2y ago
No description
Joãozinho
JoãozinhoOP2y ago
@ʎǝɹquoɯ
monbrey
monbrey2y ago
Would rather you didn't ping me
monbrey
monbrey2y 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ãozinhoOP2y ago
No description
Joãozinho
JoãozinhoOP2y ago
I wanted to pull this from his personalized status
monbrey
monbrey2y ago
I dont need to see the member object, I need to know where you're getting it from
Joãozinho
JoãozinhoOP2y ago
guildMemberAdd
monbrey
monbrey2y ago
So they're joining the guild? I actually would have thought that would include a presence Thonk
Joãozinho
JoãozinhoOP2y ago
I want to pull his status
Joãozinho
JoãozinhoOP2y ago
No description
Joãozinho
JoãozinhoOP2y ago
How can I do it?
monbrey
monbrey2y ago
Well you need his presence first
Joãozinho
JoãozinhoOP2y 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
monbrey2y 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 docs2y 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ãozinhoOP2y ago
No description
Joãozinho
JoãozinhoOP2y ago
member22.presence gives null
duck
duck2y 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

Did you find this page helpful?