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

109
Visualizações
MessageAttachment BufferResolvable

I am trying to send an embed with an image thumbnail, passing in Buffer in MessageAttachment but does still not show the image in embed thumbnail.

var attachment = new MessageAttachment(BufferData, `${player.username}_head.png`);

Example of the buffer.

<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 b4 00 00 00 a7 08 06 00 00 00 b8 8f 76 07 00 00 08 06 49 44 41 54 78 9c ed dc ad ce 5d 45 14 ... 2061 more bytes>```

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

0

The attachment:// protocol is a Discord API feature, not Discord.JS.

To use it, you need to attach the file to the message, then use the attachment's name to use it as thumbnail.

const attachment = new MessageAttachment(BufferData, `${player.username}_head.png`);
const exampleEmbed = new MessageEmbed()
    .setTitle('Some title')
    .setImage(`attachment://${player.username}_head.png`);

channel.send({ embeds: [exampleEmbed], files: [attachment] });

The official guide has some examples: https://discordjs.guide/popular-topics/embeds.html#attaching-images

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