Discord.js Bot Welcomes Member, Assign a Role and send them a DM

Your code looks fine, the problem is that the event isn’t triggered. Thats because discord turned off “privileged intents” by default.

Some intents are defined as “Privileged” due to the sensitive nature of the data. Those intents are:

  • GUILD_PRESENCES
  • GUILD_MEMBERS

One effect of that is what you are experiencing, the not working guildMemberAdd event.

The good news is that you can fix this with one easy step. Simply enable Privileged Gateway Intents in the discord developer portal and it should work just fine.

enter image description here

If you want to read more about it

Leave a Comment