A
A
AlmondPark336092021-06-23 00:13:52
Node.js
AlmondPark33609, 2021-06-23 00:13:52

How to give a role to a new discord js member?

How to give a role to a participant who has just logged into the server? I tried

client.on('guildMemberAdd', (guildMember) => {
      guildMember.roles.add('айди моей роли')
})

But it doesn't work :/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-06-23
@AlmondPark33609

Sanity check: does the bot have the appropriate intents and rights?
Moreover, intents should both be requested by the code and be included in the bot developer panels.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question