Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
Búfer de datos adjuntos de mensajes resoluble

Estoy tratando de enviar una incrustación con una miniatura de imagen, pasando Buffer en MessageAttachment pero aún no muestra la imagen en la miniatura incrustada.

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

Ejemplo del búfer.

 <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 answers
Answer question

0

El protocolo attachment:// es una característica de la API de Discord , no Discord.JS.

Para usarlo, debe adjuntar el archivo al mensaje y luego usar el nombre del archivo adjunto para usarlo como miniatura.

 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] });

La guía oficial tiene algunos ejemplos: https://discordjs.guide/popular-topics/embeds.html#attaching-images

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!