Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

236
Visualizações
How to filter the member counter in discord.js v13

I made a member counting system for my server but it counts every member that is joined. I want to filter the counter to just count the humans/users

My code:

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);
 }

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

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can just filter through all the members in a server and remove all the members which are bots by checking the member.user.bot property. You can then update your code to:

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda