How can I pull up the person's status?
I'm trying member.presence it's giving null
23 Replies
- 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 staffDo you have the guild presences intent?
yes
@ʎǝɹquoɯ
Would rather you didn't ping me
Whatever member you checked just isn't present right now it would seem. null is valid, if theyre offline or similar
I wanted to pull this from his personalized status
I dont need to see the member object, I need to know where you're getting it from
guildMemberAdd
So they're joining the guild? I actually would have thought that would include a presence
I want to pull his status
How can I do it?
Well you need his presence first
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
You can try force-fetching the guild member, not sure if that will grab it, or wait for a presenceUpdate event
GuildMember#fetch()
Fetches this (event) Client#presenceUpdate
Emitted whenever a guild member's presence (e.g. status, activity) is changed.
member22.presence
gives null
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