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

180
Visualizações
how can i make a bot status with member counter?

i wanted to set a member counter status for my bot the code is:

client.on('ready', () => {
    setInterval(() => {
      targetGuild = client.guilds.cache.get('I Pasted my Guild ID Here')
      if(targetGuild) {
          client.user.setPresence({ game: { name: targetGuild.memberCount + 'Members', type: 'WATCHING' }, status: 'online'  })
                .then(console.log)
                .catch(console.error);
      }
    }, 1000 * 60 * 5);

});

And the error is:

client.user.setPresence(...).then is not a function
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

In discord.js v13, setPresence returns a ClientPresence, not a Promise as in v12, so there is no .then() method.

about 4 years ago · Juan Pablo Isaza Relatório

0

If you are using djs v13 you need to use:

client.user.setPresence({ 
activities: [{ name: `${targetGuild.memberCount} Members`, type: 'WATCHING' }], 
status: 'online'
})

And also there is no .then() method because in discord.js v13 setPresence doesn't return a Promise but ClientPresence

about 4 years ago · Juan Pablo Isaza 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