Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
how do i display all the members with a specific discord role in my website

I am trying to display in my HTML website all the members who have a specific role (for example to display all members that have the "boss" role in my server) but i cant find anything to do it. I have some code that finds the member counter which i am not sure if its any similar to what i need to do. the code is as follows (also i need to mention that i am a beginner in JS)

<span id="discord-counter"></span>
              <script type="text/javascript">
                  var request = new XMLHttpRequest();
                  request.open('GET', 'https://discordapp.com/api/guilds/792895591255769098/embed.json', true);

                  request.onload = function() {
                  if (request.status >= 200 && request.status < 400) {
                      // Success!
                      console.log("Success")
                      var data = JSON.parse(request.responseText);
                      document.getElementById("discord-counter").innerHTML = data.members.length;


                  } else {
                      console.log("We reached our target server, but it returned an error")
                      // We reached our target server, but it returned an error

                  }
                  };

                  request.onerror = function() {
                  // There was a connection error of some sort
                  };

                  request.send();
              </script>
about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

With "modern" browsers it has become much easier to get server data asynchronously by using fetch(). In the following snippet I filtered for members that have a status of "online":

fetch("https://discordapp.com/api/guilds/792895591255769098/embed.json")
 .then(r=>r.json())
 .then(d=>console.log(d.members.filter(e=>e.status=="online")));

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda