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

234
Views
Cómo filtrar el contador de miembros en discord.js v13

Creé un sistema de conteo de miembros para mi servidor, pero cuenta cada miembro que se une. Quiero filtrar el contador para contar solo los humanos/usuarios

Mi código:

 module.exports = async (message, args, cmd, client, Discord, profileData) =>{ const guild = client.guilds.cache.get('847071265100791849'); setInterval(() =>{ const memberCount = guild.memberCount; const channel = guild.channels.cache.get('863783336860975114'); channel.setName(`Users: ${memberCount.toLocaleString()}`); }, 60000); }

Estoy usando discord.js v13 y node.js v16

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Simplemente puede filtrar a través de todos los miembros en un servidor y eliminar todos los miembros que son bots al verificar la propiedad member.user.bot . A continuación, puede actualizar su código a:

 const guild = client.guilds.cache.get('847071265100791849'); setInterval(() => { let humanMembers = guild.members.cache.filter( (user) => !user.user.bot // This checks if the the user is a bot ); const channel = guild.channels.cache.get('863783336860975114'); channel.setName(`Users: ${humanMembers.size.toString()}`); }, 60000);
about 4 years ago · Santiago Trujillo 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!