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

204
Views
Cannot read properties of undefined (reading 'fetch') on guild.members.fetch()

I am working on setting a script that will cycle thorough all the members in a guild without using the cache system. I am getting an issue where when I use guild.members.fetch() it treats guild.members as undefined. I know it isn't because I am currently logging guild.members and it is giving me a GuildMemberManager object. I don't understand when once I use fetch() on it, it is suddenly being viewed as undefined. Here is a screenshot of the entire error message

function addMissingJsons(message, bot) {
    bot.guilds.fetch("id").then(guild => {
        console.log(guild.members);
        guild.memebers.fetch().then(members => {
            console.log(members);
        });
    });
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As @mswgen said, you have a typo. It should be guild.members not guild.memebers. Your code should look like this:

function addMissingJsons(message, bot) {
    bot.guilds.fetch("id").then(guild => {
        console.log(guild.members);
        guild.members.fetch().then(members => {
            console.log(members);
        });
    });
}


Since the comment worked, this is just a response for you to mark as the best answer to close the thread.

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!