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.