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

364
Visualizações
How to count amount of reactions in Discord.js v13?

I have tried so many things out, here's my current code

        var green = toString(msg.reactions.cache.get('🟩').count);
        var red = toString(msg.reactions.cache.get('🟥').count);
          
         msg.reply("Poll has ended which was created by " + msg.author.username)
         msg.reply(green + " " + red)

It gives this error

        var green = toString(msg.reactions.cache.get('🟩').count);
                                                          ^

TypeError: Cannot read properties of undefined (reading 'count')

Please help!

I want it to display how many people reacted on 🟩 and 🟥.

I'm not able to do that even after asking Discord.js experts, I can't understand how to get them.

I also want them to be a string, that's why I used The toString() function.

This is for a poll/vote bot I am making.

I react to the messages and still it shows this error.

This is Discord.js v13.

Thanks!

TheThiefingKing

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

0


let msg = await message.channel.messages.fetch("974311411314475059")
let reactsSize = msg.reactions.cache.get("✅").count
message.channel.send("✅ Reacts on that message is: " + (+reactsSize))

You need to await message first after that you can fetch reactions.

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