Home > OS >  user.presence.status is now working in discord.js v13
user.presence.status is now working in discord.js v13

Time:05-31

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(`           
  • Related