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

229
Visualizações
'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 à 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