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 :: fs , valid path check 
Javascript :: add key vakue to front of object 
Javascript :: bootstrap switch on change 
Javascript :: javascript infinite parameters 
Javascript :: javascript date time formating 
Javascript :: react environment 
Javascript :: how to pass state values as initial data and support state updates for Formik while using useFormik hook 
Javascript :: axios send post data 
Javascript :: how to get href value of anchor tag in jquery in list 
Javascript :: jquery siblings 
Javascript :: how to auto refresh a div js 
Javascript :: Reading Time with jquery 
Javascript :: reverse 179 in javascript 
Javascript :: btn.addeventlistener 
Javascript :: convert iso string to datetime javascript 
Javascript :: javascript validate password 
Javascript :: uncaught evalerror: refused to evaluate a string as javascript because 
Javascript :: react autocomplete off for password chrome 
Javascript :: jquery select element with two classes 
Javascript :: copy to clipboard using javascript 
Javascript :: split string in angular 8 
Javascript :: express return json 
Javascript :: base 64 in js 
Javascript :: jquery get meta value 
Javascript :: cdn react 
Javascript :: how to change image source using javascript 
Javascript :: javascript get html slider value 
Javascript :: emit resize event in angular 
Javascript :: iframe chrome devtool 
Javascript :: reduce parameters 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =