I want my bot to send ascii art. The art is contained in a text file because it's more organized, but when i try to make the bot send it it just sends the file download. I am currently using await ctx.send(file=discord.File('file path'))
. How do i convert the contents of the file to a string that can be sent as a message?
You need to open the txt file read its content and send it
with open("filename.txt") as f:
content = "\n".join(f.readlines())
await ctx.send(content)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments