0

I have an image created using Pillow that I would like to send in an embed (ie by using embed.set_image) and without saving the image into the hard drive. I have seen other posts on Stack but they suggest sending the image as a file with

with io.BytesIO() as image_binary:
        image.save(image_binary, 'PNG')
        image_binary.seek(0)
        await channel.send(embed = embed, file=discord.File(fp=image_binary, filename='image.png'))

which is not my usecase because it sends the image as a file and messes with the formatting (eg if I have a footer) - I want the image to be part of the embed.

Is it possible to do something along the lines of embed.set_image(image_binary)?

medihde
  • 21
  • 7
  • I don't know what you mean by *"that is not my use case"*, but maybe you just want `image_binary.get_value()` Example here https://stackoverflow.com/a/73819899/2836621 – Mark Setchell Oct 23 '22 at 08:56
  • @MarkSetchell I edited my post. I want to use the .set_image method of the embed and not have the image as an attached file – medihde Oct 24 '22 at 09:50

0 Answers0