#images

12 messages · Page 1 of 1 (latest)

past cypress
#

hello, i am trying to send an image in an embed with a buffer but I couldnt find how to do this

primal jettyBOT
#

MessageEmbed#attachFiles has been removed. Files should be attached via the message option object instead:

  const attachment = new MessageAttachment('./image.png', 'image1.png');
  const embed = new MessageEmbed()
-   .attachFiles([attachment])
    .setTitle('Attachments')
    .setImage(`attachment://${attachment.name}`);

- channel.send(embed)
+ channel.send({
+   embeds: [embed],
+   files: [attachment]
+ });
junior fiber
#

and put buffer instead of file path

inner marlin
marsh ravine
#

yes you can lol

inner marlin
#

how

marsh ravine
#

with MessageAttachment

#

which literally takes a file path or a buffer

primal jettyBOT
inner marlin
#

but how do you add the image to the embed

inner marlin
#

oh