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