Files and Attachment are not working, "giving attribute errors"
Summary
discord.Files and discord.Attachment are giving attribute error when awaited or saved
Reproduction Steps
bytesio = io.BytesIO()
background.save(bytesio, "PNG")
bytesio.seek(0)
file = Attachment(bytesio, filename="yourfile.png")
await ctx.send(file=file)
Minimal Reproducible Code
No response
Expected Results
bytesio = io.BytesIO()
background.save(bytesio, "PNG")
bytesio.seek(0)
file = Attachment(bytesio, filename="yourfile.png")
await ctx.send(file=file)
tthought this will send me the image (file)
Actual Results
gave me an attribute error

Intents
default
System Information

Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
Additional Context
No response
The error clearly states that the background variable which is an Editor object doesnt have a "save" attribute. Are you sure this problem is related to this library?
The error clearly states that the
backgroundvariable which is anEditorobject doesnt have a "save" attribute. Are you sure this problem is related to this library?
yes because i even tried without saving
The following example seemed to work for me in my testing with discord.File, I used a random image for reference
# Reading bytes from a random image into a bystream.
with open("random_image.png", "rb") as image:
f = image.read()
b = bytearray(f)
# Creating BytesIO object from bytestream
myio = io.BytesIO(b)
# Sending file named "random_image_2.png" composed from the bytestream
file = discord.File(myio, filename="random_image_2.png")
await ctx.send(file=file)
I'm using easy_pil
On Tue, 14 Sep 2021, 9:52 pm OEUG99, @.***> wrote:
The following example seemed to work for me in my testing with discord.File, I used a random image for reference `
Reading bytes from a random image into a bystream.
with open("random_image.png", "rb") as image: f = image.read() b = bytearray(f)
# Creating BytesIO object from bytestream myio = io.BytesIO(b) # Sending file named "random_image_2.png" composed from the bytestream file = discord.File(myio, filename="random_image_2.png") await ctx.send(file=file)`
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Pycord-Development/pycord/issues/193#issuecomment-919308818, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATUQKPJSMVQ4KJGIOZ3GVHDUB5ZDPANCNFSM5EAI56QA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
This is not a bug with this library, your background doesn't have a save method.