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

493
Visualizações
(DISCORD.JS V13) client.guilds.cache.get is not working properly

Im making a bot in discord.js v13, and i wanted to return client's number of guilds/users/channels. But it returns function get() { [native code] } instead.

        const main = new MessageEmbed()
            .setColor("#6164ab")
            .addField("<:discordReply:971028493645262888> Stats", `• ${client.guilds.cache.get} guilds\n• ${client.users.cache.get} users\n• ${client.channels.cache.get} channels`)

        await interaction.reply({ embeds: [main], ephemeral: true })

This is my code. Thanks.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

The correct property for getting the number of entries turned out to be .size and not .get.

about 4 years ago · Juan Pablo Isaza Relatório

0

In Discord.JS docs, as i see guilds.cache is returning a collection and it has properties to get size. So you can basically get size of guilds with;

client.guilds.cache.size // => Returns number

More info

Unfortunately, .get is method and so it should be .get() which is returning undefined...

More info

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