Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

200
Visualizações
Cannot read properties of undefined (reading 'users') | interaction.client.api.users | Discord.js V14

This Error: Console Error

TypeError: Cannot read properties of undefined (reading 'users')
    at Object.execute (D:\Mortal\Belgeler\Kod Denemeleri\Discord Botu\Via\v4 (v14)\commands\Kullanıcı\profil.js:34:55)
    at module.exports (D:\Mortal\Belgeler\Kod Denemeleri\Discord Botu\Via\v4 (v14)\events\interactionCreate.js:28:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

And this my code: Error

const APIFetch = await interaction.client.api.users(user ? user.id : interaction.user.id).get()

I could not find the solution to the problem on the internet because it is a new version. I researched for about 2 hours; At first, I looked at the sites and then looked at what data I could pull through interaction or the client. We can't pull API data. That's why we get the error "users" can't be read. At least that's it, as I understand it... How do I resolve this error?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Use interaction.client.users directly:

const data = await interaction.client.users.fetch(user ? user.id : interaction.user.id);
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda