join message bot discord code v12 code example
Example 1: discord.js message on member add
client.on('guildMemberAdd', member => {
member.send("Welcome!");
});
Example 2: how to reference the bot joining a server in discord.js
client.on('guildCreate', guild => {
const channel = guild.channels.cache.find(channel => channel.type === 'text' && channel.permissionsFor(guild.me).has('SEND_MESSAGES'))
channel.send("Thanks for inviting me")
})