So I am coding a discord bot with discord.js and one of the features is that when a new user joins the server the bot sends a message. I am not making it an embed for now, I can do that myself later.
Here is my main welcome.js
file specifically made for this feature:
module.exports = (client) => {
const channelId = '868192573011931185' //welcome channel
client.on('guildMemberAdd', (member) => {
console.log(member.name)
const message = `Hello <@${member.id}> and welcome to ${guild.name}!
Please verify through the Server Captcha Bot in your DMs,
then read the rules in <#868192573263605884>
and lastly pick your roles in <#868192573263605880>!`
const channel = member.guild.channels.cache.get(channelId)
channel.send(message)
})
}
And in my index.js
file I just imported the file, and added welcome(client)
.
But for some reason my code is not showing up in the Welcome channel... Any help will be appreciated.