Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

759
Views
user.presence.status is now working in discord.js v13

I wanted my bot to set the name of a channel: the number of users. I wanted to filter online/dnd/idle members and offline members. but my code is not working.

My code:

let humanMembers = guild.members.cache.filter(
  (user) => !user.user.bot
);
let onlineMembers = guild.members.cache.filter(
  (member) => !member.user.bot && member.user.presence.status !== "offline"
)
const channel = guild.channels.cache.get('863783336860975114');
channel.setName(`๐Ÿš€ Online: ${onlineMembers.size.toString()}/${humanMembers.size.toString()}`);

The error:

cannot read properties of undefined <reading 'status'>
at main.js:37:65

I am using discord.js v13 and node.js v16

about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

User.presence has been removed in v13

You can use GuildMember.presence if you have GUILD_PRESENCES intent enabled.

Instead of using member.user.presence use member.presence

about 4 years ago ยท Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!