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

175
Views
¿Cómo hago para que un comando le dé a la primera mención un rol con el ID "973182673306660885"?

He intentado esto pero de alguna manera "msg.mentions.users.first.addRole no es una función"

 let BotBanRole = msg.guild.roles.cache.find(r => r.id === "973182673306660885"); const FMT = msg.mentions.users.first(); if (msg.content.startsWith('$BotBan')) { if (FMT === undefined) { msg.reply('Did not detect user') return; // Do not proceed, there is no user. } const FM = FMT.username; // Do stuff with the username msg.mentions.users.first.addRole(BotBanRole); msg.reply('Bot Banned ' + FM.tag) }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

let BotBanRole = msg.guild.roles.cache.get("973182673306660885"); const FMT = msg.mentions.members.first(); if (msg.content.startsWith('$BotBan')) { if (!msg.mentions.members.first()) { msg.reply('Did not detect user') return; // Do not proceed, there is no user. } const FM = FMT.user; // Do stuff with the username FMT.roles.add(BotBanRole); msg.reply('Bot Banned ' + FM.tag) }

Edité tu código y si es v13, funciona así.

about 4 years ago · Juan Pablo Isaza Report

0

Estuviste bastante cerca, pruébalo.

 const BotBanRole = msg.guild.roles.cache.find(r => r.id === "973182673306660885"); const FMT = msg.mentions.members.first(); if (msg.content.startsWith('$BotBan')) { if (!FMT) { msg.reply('Did not detect user') return; } else { FMT.roles.add(BotBanRole); msg.reply(`Bot Banned ${FMT.user.username}`) } }
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!