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

204
Visualizações
Get a user by username?

I would like to get a user by the username. I know how that works:

let user = client.users.find(user => user.username == "TESTname");

But what if there are 2 users who have the same username?

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

0

although getting a user with username instead of with id is a terrible idea, here is how you can do it with V13 :

const users = client.users.cache.filter(user => user.username == "TESTname");

consider it is preferable to have the ID of the user, so you can fetch it directly from Discord:

client.users.fetch("304541381798658048").then(user => {
console.log(user)
})
about 4 years ago · Santiago Gelvez 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