I tried to make a simple welcomer bot, but I ran into an issue, sometimes the bot send a welcome message twice or more times, and I can't figure out why it's happening. Here's my code and a picture of the bug.
Code:
client.on("guildMemberAdd", async (member) => {
let welcomeChannel = member.guild.channels.cache.find(channel => channel.name === "??új-tagok");
let welcomer = new Discord.MessageEmbed()
.setTitle(`${member.guild.name}`)
.setColor("#FF8A00")
.setThumbnail("https://i.redd.it/f1u2wf28nqn21.jpg")
.setDescription(`D-${getRandomInt(0, 9)}${getRandomInt(0, 9)}${getRandomInt(0, 9)}${getRandomInt(0, 9)}, más néven ${member.user.username} csatlakozott a szerverre!`);
welcomeChannel.send(welcomer);
});
Picture: https://imgur.com/a/MgIt6oD