Is there a way that I could make my bot add a role to a member upon joining the server? I want it to add "Member" role
What I have so far
var role = message.guild.roles.find(role => role.name === "MyRole");
message.member.addRole(role);
CodePudding user response:
There are many ways to give roles to your members. One of the easiest ways is to just give the list of role IDs (in your case just one).
message.member.roles.add(['role-id']);
Not sure if the bot's role matter anymore, but at one point bot's role on the server must be higher than the role given out. So make sure to do so.