1

I'm trying to make it so when a user joins, the bot sends a message in a certain channel. I saw that you needed to enable some things in the developer portal, so I did that but it still doesn't run when a user joins, I tried printing when the user joins but it still wont do anything.

client.on('guildMemberAdd', joinMember => {
    console.log("a")
    const joinChannel = client.channels.cache.find(channel => channel.name === 'logs')
    let joinEmbed = {
        title : `Welcome to ${client.guild.name}, @${joinMember.tag}`,
        color : embedColor
    }
    joinChannel.send({embeds : [joinEmbed]})
})
Tom W
  • 59
  • 2
  • 9

1 Answers1

0

Guild member related events are privileged intents.

It means that you have to turn it on at your bot page.

enter image description here

User presence related events are also privileged, and message content related events are also privileged after April 30.

mswgen
  • 636
  • 1
  • 9
  • 18