Checking if a user is mobiile
Ngl I tryed using gpt because I doubt anyone has ever gotten code for this lol
21 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!Although you haven't actually expressed your issue, one main issue is regarding
<Message>.author
, which is a User object. Presences are only available on member data, so you want <Message>.member
issue is im not sure if what im trying is even possible lol
If you have the right intents and code, yes, you can get the mobile status of a given member
GuildMembers and GuildPresences intent will be necessary for this
And as a side note, you'd be better off just getting help with d.js in this server. ChatGPT and any other AI has been proven to be quite unreliable both in d.js and outside of it
true
ai is shit but its 3am and didnt think anyone would be online
better question where can I find the docs for this
This place has people from all over the globe, so there's bound to be a few people lurking at a given time
can you give me a explanination of why I cant get the users device
WAIT HOLD ON
I MIGHT BE COOKING
That’s a bit vague, what’s preventing you? What’s the code above you posted? Have you tested it? Does it work? Does it error?
it doesnt error
wish code errored
I’m also not sure why you’re traversing the member cache via the author’s ID when I mentioned you can simply do
<Message>.member
What unintended behavior is it giving?cant find my shit
cant tell if im using pc
or phone
Log some values, see what’s going on, do some debugging
"Cannot determine user status."
Do you have both of these intents?
GuildPresences oh
You should also be aware that GuildMembers are not cached by default, so if you haven’t received any other events that include that member, then it won’t be in the cache meaning you’ll have to fetch it first
const {Client, GatewayIntentBits, SlashCommandBuilder, EmbedBuilder, ActivityType, Partials, GuildMembers, GuildPresences}=require('discord.js');
Those are not intents, those are imports
ah
now that you told me that I got a diff message 😄
GatewayIntentBits.GuildPresences,
🎊
W
W