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

  • Discord.js Official Guide – Gateway Intents
  • Discord Developer Documentation – Gateway Intents
  • Gateway Update FAQ
  • Discord API Github – Issue 1363 – Priviledged Intents
  • Discord Blog – The Future of Bots on Discord
  • None of my discord.js guildmember events are emitting, my user caches are basically empty, and my functions are timing out?

Leave a Comment