1// This is the needed event to use the welcome!
2bot.on('guildMemberAdd', async newMember => {
3 // IMPORTANT NOTE: Make Sure To Use async and rename bot to client or whatever name you have for your bot events!
4 const welcomeChannel = newMember.guild.channels.cache.find(channel => channel.name === 'the channel name here, make sure the ')
5 welcomeChannel.send('Input your message here, if you want an embed then do a "let msgEmbed = new Discord.messageEmbed / and input the title and all the embed stuff, customize the message as much as you want!"')
6
7
8 // Optional Part (you can modify those extra things if you'd like!) :D
9 let msgEmbed = new Discord.MessageEmbed()
10 .setTitle (`This is a title for a test`)
11 // welcomeChannel.send(msgEmbed) | (that's commented so you know to use it only if you want an embed and also don't delete the other "welcomeChannel.send" just change it in there and say "welcomeChannel.send(msgEmbed)" and define the msgEmbed variable as a let and define it above the "welcomeChannel.send" so the bot will check and see that it's defined so errors won't happen!
12 if (newMember.bot) return; // checks if it's a bot that joined so the channel won't be spammed with "*Discord Bot* has joined the server" and stuff like that, so check that.
13 const newbieRole = newMember.roles.cache.find(role => role.name === 'Role Name here') // that was to define the role to give newbies (you can name the variable however you want that doesn't matter!)
14 newMember.roles.add(newbieRole.id) // this will add the role to that member!
15 // All the things that are under the "Optional Part" are 100 % Optional! No Requirement to use those, just use it if you want and they won't affect the welcome message at all!
16})