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)
?