This is the welcome message and leave message I have set up with my discord bot. It is currently not working. It is not sending any errors. If you can help me out It would be appreciated. This is one of the bugs that I have not been able to fix. It may just be a simple error that I have made.
client.on('guildMemberAdd', member =>{
const welcomemessage = new Discord.MessageEmbed()
.setColor("#0099ff")
.setDescription(`Welcome <@${member.user.id}> to the server! Please take the time to read <#758441509371641866> and <#758441426807423056>`);
message.guild.member.cache.get(user.id).then(function(){
let userjoinchat = message.guild.channels.cache.find(x => x.name === "welcome");
userjoinchat.send(welcomemessage);
})
})
client.on('guildMemberRemove', member =>{
const byemessage = new Discord.MessageEmbed()
.setColor("#0099ff")
.setDescription(`Bye <@${member.user.id}>, I hope you enjoyed your stay!`);
message.guild.member.cache.get(user.id).then(function(){
let userleavechat = message.guild.channels.cache.find(x => x.name === "bye");
userleavechat.send(byemessage);
})
})