Add MEMBER to username when joined

Greetings everyone,

I am trying making my bot change the nickname to Member when someone joins but I have no idea how to make that… If someone could help

EXAMPLE:

If a member named Noob join the bot will change it name to: [Member] Noob

Thanks in advance!

Here is some code for discord.js.

// on member on event
<client>.on('guildMemberAdd', member => {
  // set the members nickname
  member.setNickname("[Member] " + member.username);
});

You will need to turn on member intents.

1 Like

Nice! But I get [Member] undefined…

What causing this?

Neverming just had to change member.username by member.displayName

1 Like