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

227
Views
How to fix DiscordAPIError: Unknown Member?

I have had a discord bot running for about 3 months, and today I started getting this DiscordAPIError: Unknown Member error message. It is coming from an interaction:

  client.on("interactionCreate", async interaction => {
    interaction.member.roles.add(<roleId>);
  });

I am unable to consistently reproduce the error, but it seems like it may be coming from new members joining the server, and perhaps the discord API is not recognizing them as a guild member just yet. The server had a large influx of users today, and that's when the issue started.

Is there any way I can work around this issue, or perhaps force update the guild's member list?

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

0

The member does not seem to be properly cached. Before accessing it, use await interaction.member.fetch()

client.on("interactionCreate", async interaction => {
    await interaction.member.fetch()
    interaction.member.roles.add(roleId)
})
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!