Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get discord.js role

let role = message.guild.roles.cache.find(r => r.id === "Role ID");

// The member you want to add the role to
let member = message.mentions.members.first();

// Add role to the member
member.roles.add(role);

// Or add it to yourself
message.author.roles.add(role);
Comment

discord.js find role by name

let role = message.guild.roles.cache.find(role => role.name === "Rolename");
Comment

PREVIOUS NEXT
Code Example
Javascript :: get element text puppeteer 
Javascript :: javascript set target blank 
Javascript :: open link in new window chrome mac shortcut 
Javascript :: detect os javascript 
Javascript :: javascript scroll to bottom 
Javascript :: jsonschema string enum 
Javascript :: import path in ES6 module 
Javascript :: strip html tags javascript 
Javascript :: node js favicon.ico 
Javascript :: get last day of month javascript 
Javascript :: credit card regex javascript 
Javascript :: socket io esm 
Javascript :: square all numbers in array javascript 
Javascript :: apply back button to a react component 
Javascript :: check type string javascript 
Javascript :: image next src url 
Javascript :: convert/replace space to dash/hyphen javascript 
Javascript :: transformorigin gsap 
Javascript :: javascript get domain name from string 
Javascript :: nodejs delete folder recursively 
Javascript :: javascript change element class 
Javascript :: python dictionary to json 
Javascript :: how to get date time day year in javscript 
Javascript :: check if radio button is checked 
Javascript :: npm run test:coverage command in jest 
Javascript :: increment day date javascript 
Javascript :: delete all childs in node 
Javascript :: copy an array without pointer in angular 
Javascript :: javascript set input value by class name 
Javascript :: jquery click event 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =