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

280
Visualizações
When I try to use client.user.setAvatar(), nothing happens

I am trying to change to bot avatar to a certain user's avatar, but am having trouble.

I tried:

client.users.fetch('userid').then((user) => {
    client.user.setAvatar(user.avatarURL());
});

It doesn't work and the avatar doesn't change.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Change your code to this:

client.users.fetch('userid').then((user) => {  client.user.setAvatar(user.avatarURL().replace("webp","png");
});

Avatar URL is just the image link. Discord CDN can automatically generate image in different format if you change image format in the link itself. Therefore I did the same above.

about 4 years ago · Juan Pablo Isaza 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