Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
'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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!