Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

359
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda