Status Checking
I am starting this project from scratch and a new dev, I am wondering how I can make my bot (from my user id) obtain my presence and status and print it.
For example, if i am on Do not Disturb and I am listening to spotify. it will print:
17 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!all of the data you want is included in a member's
presence
data, linked above. it requires the privileged GuildPresences
intent to accessAlright thank you
it keeps saying my presence is undefined
Show code
let me find it agian
@Mark
* channels are cached, you don't need to fetch them
* you're using message.author, which returns a User. as Mark linked, the presence data is in the GuildMember instead. use Message#member
do consider that member will be null if the message wasn't sent on a guild
It was sent in a guild
Do I do message.member.presence?
yeah, I think that'll work
Alright I’ll try that soon
if not you could try force fetching it but I don't recall if that was needed for presences
Idek how to do that
i got message.member.presence.status to show dnd but i cant figure out how to show the activity
which in this case is spotify
if i do message.member.presence.activity it says undefined
wait
i got it
its activityies
do you know how i would make it filter to only do 1 of the activities and that being the first one.
@Amgelo thank you so much, im just wondering is there anyway to get the details of an activity?
for example if i want it to say Listening to spotify, then the track name