I've had a bot working for my discord server for a while now and it worked perfectly, but suddenly one day it stopped sending the greeting messages. I don't know why it has happened, but I've tried everything I can and nothing works.
The console displays no error and no message is sent to the channel.
Here's the code:
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.find(ch => ch.name === 'greeting-channel');
if (!channel) return;
channel.send(`Welcome to the server, ${member}!`);
});
Please, help me!