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

132
Views
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 answers
Answer question

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 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!