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

177
Views
¿Hay alguna forma de saber quién le dio el rol al sistema de registro que estoy haciendo?

Quería crear un sistema de registro de roles para mi servidor de juegos de roles, pero necesito que el bot obtenga el nombre de quién le dio el rol a esa persona.

 client.on("guildMemberUpdate", (oldMember, newMember) => { // Old roles Collection is higher in size than the new one. A role has been removed. if (oldMember.roles.cache.size > newMember.roles.cache.size) { // Creating an embed message. const Embed = new Discord.MessageEmbed(); Embed.setColor("RED"); Embed.setAuthor(newMember.user.tag, newMember.user.avatarURL()); // Looping through the role and checking which role was removed. oldMember.roles.cache.forEach(role => { if (!newMember.roles.cache.has(role.id)) { Embed.addField("Role Removed", role); } }); client.channels.cache.get("872558074290896908").send(Embed); } else if (oldMember.roles.cache.size < newMember.roles.cache.size) { const Embed = new Discord.MessageEmbed(); Embed.setColor("GREEN"); Embed.setAuthor(newMember.user.tag, newMember.user.avatarURL()); // Looping through the role and checking which role was added. newMember.roles.cache.forEach(role => { if (!oldMember.roles.cache.has(role.id)) { Embed.addField("Role Added", role); } }); client.channels.cache.get("872558074290896908").send(Embed); } });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Para esto, deberá usar registros de auditoría, ya que no está incluido en los argumentos proporcionados con el evento. Trabajar con registros de auditoría puede ser un poco difícil, pero la documentación tiene excelentes recursos como este para ayudarlo a comenzar: https://discordjs.guide/popular-topics/audit-logs.html

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!