fix(meme): correct error file handling for exception tracebacks 🐛

Updated the error file handling to use io.BytesIO for exception tracebacks, ensuring proper file attachment format for Discord responses.

*Generated by Github Copilot*
This commit is contained in:
2025-10-23 15:56:27 +02:00
parent 536cae3e56
commit f0a333e582
+3 -1
View File
@@ -1,3 +1,4 @@
import io
import os
import traceback
@@ -63,7 +64,8 @@ async def meme(interaction: discord.Interaction, prompt: str):
)
# Send error details as a file attachment to bypass character limits
error_file = discord.File(
fp=bytes(exception_traceback, "utf-8"), filename="exception_traceback.txt"
fp=io.BytesIO(bytes(exception_traceback, "utf-8")),
filename="exception_traceback.txt",
)
await interaction.followup.send(embed=embed, file=error_file)