I'm trying to send a text file with discord.py, but when I send the file, it seems to be empty.
An example snippet:
bytes = BytesIO()
test = b'sadfasdfsa'
bytes.write(test)
print(bytes)
await ctx.send(file=File(bytes, 'test.txt'))
This results in an empty test.txt file getting sent. Why is it not sending the contents?