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

518
Visualizações
Discord JS v13 - Get internal user ID from a user tag in discord js v13

There have been similar questions but I havent been able to find an exact match so I apologize in advance.

I have am application form that someone fills out and provides their discord user tag (ex: Bob#1111). This form then gets sent to my discord (which that user has already joined). I then process it with my bot which creates a channel, copies the application to that channel and uses the discord user tag of the applicant to get their discord information and give them permissions on that newly created channel.

This worked for a few years prior to v13 but now its no longer working. Prior code was simply :

await guild.members.fetch()
let userID = client.users.cache.find(user => user.tag === userTag)    

Any thoughts would be greatly appreciated.

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

0

Since you didn't explain what the actual issue is, I can only assume that the problem is when you try to give the user permissions for the channel.

Make sure to find the member in your server:

const member = await guild.members.cache.get(userID.id)

and then give the permissions for the found member.

about 4 years ago · Santiago Gelvez Relatório

0

For what you're trying to do, I would recommend getting the member by their ID. You can do this by doing:

const member = guild.members.fetch('user-id')

For your code, userID will in fact give you the entire user class, not just the ID. You can access the user's ID by doing userID.id.

Additionally, you can view an example of how to set channel overwrites in discord.js guide.

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