Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
How to remove a role from specific user

I wanna remove a role from specific user, cannot seem to get it working (im using Discord.js v13)

var role4 = msg.guild.roles.cache.find(role => role.name == "Role Name")

client.users.fetch("321257540442652672").roles.remove(role4)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

1) Users don't have roles, GuildMembers do. You have to get the GuildMember object

2) .fetch() returns a promise, you must handle it.

3) Ensure you receive a valid role object.

var role4 = msg.guild.roles.cache.find(role => role.name == "Role Name");
if (!role4) return console.error("No role found");

msg.guild.members.fetch("321257540442652672")
   .then(member => {
      member.roles.remove(role4);
   })
   .catch(_ => console.log("No member found");
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!