I'm currently making a discord bot using a node.js and I found a problem when I make welcome message.
This is the code :
client.on("guildMemberAdd", async member => {
let chx = db.get(`welchannel_${member.guild.id}`);
if (chx === null)
return;
let data = await canva.welcome(member, { link: "https://i.pinimg.com/originals/f3/1c/39/f31c39d56512dc8fbf30f9d0fb3ee9d3.jpg" })
const attachment = new discord.MessageAttachment(data, "welcome-image.png");
client.channels.cache.get(chx).send("Welcome to our Server " + member.user.username, attachment);
});
If I run them, nothing happens when a member joins the server.