discord.js assign role to user code example
Example 1: how to give a role to a new member in discord.js
var role = message.guild.roles.find(role => role.name === "MyRole");
message.member.addRole(role);
Example 2: add role to channel discord.js
// deleting the channels overwrite for the message author
channel.permissionOverwrites.get(message.author.id).delete();