Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. if (user.bot) return;
  2. const roleName = reaction.emoji.name;
  3. const role = reaction.message.guild.roles.find(role => role.name.toLowerCase() === roleName.toLowerCase());
  4. const member = reaction.message.guild.members.find(member => member.id === user.id);
  5. member.addRole(role.id).then(member => {
  6. console.log("Am adaugat" + member.user.username + " la un rol!");
  7. })
  8. })
  9.  
  10. const role = reaction && reaction.message && reaction.message.guild && reaction.message.guild && reaction.message.guild.roles.find(role => role.name.toLowerCase() === roleName.toLowerCase());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement