I want to send a welcome message to a new user but the code doesn't work. I tried defiant articles and video tutorials and already asked questions for help but it's not working. I already checked ( Privileged Gateway Intents > PRESENCE INTENT ) and ( Privileged Gateway Intents > SERVER MEMBERS INTENT ) here
here's my code
// Instantiate a new client with some necessary parameters.
const client = new Client(
{ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] }
)
const channelId = "969129834682929212";
const rulesChannel = "969129988299304960";
client.on("guildMemberAdd", (member) => {
console.log(member);
const message = `Welcome <@${
member.id
}> to our server! Be sure to check out our ${member.guild.channels.cache
.get(rulesChannel)
.toString()}`;
const channel = member.guild.channels.cache.get(channelId);
channel.send(message);
});