#please can someone tell me why my code doesn't work:

1 messages · Page 1 of 1 (latest)

valid sierra

module.exports = { name: 'guildMemberAdd', async execute(member) { console.log(${member} has joined the server`);
const welcomeRole = await member.guild.roles.cache.find(role => role.name === 'member');
await member.roles.add(welcomeRole);

    const welcomeChannel = await member.guild.channels.cache.find(channel => channel.name === 'welcome');
    await welcomeChannel.fetch();
    welcomeChannel.send(`Welcome ${member.user}, hope you have a good time here!``)
    
}

}
`

the welcome message or role doesn't work, and yes I have made a member role and a channel called welcome.