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

231
Vistas
'messageCreate' keeps firing when an image is attached to the message
client.on('messageCreate', message => {
  if (message.author.id === client.user.id) return;
  if (message.author.bot) return;
  var findChannel = message.guild.channels.cache.find(ch => ch.name === "temp-channel");

  if(message.channel === findChannel) {
    if(message.attachments.size > 0) {
      var playerPoints = db.get(`${message.author.id}_points`);
      if (!playerPoints) {
        db.set(`${message.author.id}_points`, 1);
      } else {
        db.add(`${message.author.id}_points`, 1);
      }
      message.reply(`**+1 Game Point**, you now have **${db.get(`${message.author.id}_points`)}** points`)
    }
  }
})

For the most part, it works. But the issue is when a message is sent with an image, it repeatedly replies to the message author non-stop. What have I done wrong here?

I've been on discord.js v12 for years, but v13 changed too much..

I have tried numerous ways to attempt to stop the bot from repeatedly replying to the author, but it doesn't work.

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