User.client.presence is null
HI!
I want to detect if user is on discord mobile version or on desktop/ web one. In documentation
I try to get it through such line in my commancbuilder
interaction.user.client.presence.clientStatus
But i can only see if user is online, rest is null.
I looked up what only presence return and here is result
Can i fetch somehow clientstatus?
9 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!do you have the GuildPresences intent
Yup! Still nothing
just to clarify, are you looking for the
clientStatus
of your bot or the user who used this command?of the user who uses this command
I want to know if user is on mobile version or desktop
<User>.client
is your Client
instance, so <User>.client.presence
is your bot's presence
you'd be looking to access <Interaction>.member.presence
That works! Thank you!
I have got one question.
Can i get clientStatus of user in DM or not? There is no GatewayIntentBit of DMPresences as far as i know in documentation
there is no means of accessing presence through a
User
you would need a GuildMember
That's so smart! Thank you so much!
Case closed