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

542
Views
Discord API: obtenga insignias de usuario usando public_flags

Estoy usando javascript y estoy buscando cómo obtener una lista de banderas (de public_flags) que un usuario tiene como ejemplo:

 [ "House Bravery", "Partnered Server Owner", "Early Verified Bot Developer" ]

No estoy usando discord.js

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Esto funciona si está tratando de obtenerlos de un objeto de usuario:

 await user.fetchFlags().toArray() // would return an array as you require
about 4 years ago · Juan Pablo Isaza Report

0

Descubrí cómo lograrlo con vainilla javascript:

 var badges = []; var flags = response.public_flags flags = response.public_flags if ((flags & badges2.Discord_Employee) == badges2.Discord_Employee) { badges.push("Discord Employee") } if ((flags & badges2.Early_Supporter) == badges2.Early_Supporter) { badges.push("Early Supporter") } if ((flags & badges2.House_Balance) == badges2.House_Balance) { badges.push("House Balance") } if ((flags & badges2.House_Brilliance) == badges2.House_Brilliance) { badges.push("House Brilliance") } if ((flags & badges2.House_Bravery) == badges2.House_Bravery) { badges.push("House Bravery") } if ((flags & badges2.Bug_Hunter_Level_1) == badges2.Bug_Hunter_Level_1) { badges.push("Bug Hunter LVL.1") } if ((flags & badges2.Bug_Hunter_Level_2) == badges2.Bug_Hunter_Level_2) { badges.push("Bug Hunter LVL.2") } if ((flags & badges2.Early_Verified_Bot_Developer) == badges2.Early_Verified_Bot_Developer) { badges.push("Verified Bot Dev") } if ((flags & badges2.HypeSquad_Events) == badges2.HypeSquad_Events) { badges.push("HypeSquad Events") } if ((flags & badges2.Partnered_Server_Owner) == badges2.Partnered_Server_Owner) { badges.push("Partnered Server Owner") }
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!