Closed MysteryPancake closed 5 years ago
You could always not put a special character in the filename though. I don't think it's the responsibility of Discord.js to sanitize your filenames for the API. That's why it returns API errors to you.
I agree - I noticed that the filenames are also cut to a certain length, and I thought this was a feature of Discord.js rather than Discord's API itself.
It would be good to have a more descriptive error though - I only named a file this way by accident, and it took a lot of trial and error to work out the issue.
Please describe the problem you are having in as much detail as possible: Discord.js does not correctly deal with special characters (such as
\n
) in attachment file names, causing the API error "Cannot send an empty message", and failing to send the attachment.Include a reproducible code sample here, if possible:
Further details:
discord.js version: latest (master)
Node.js version: v10.6.0
Operating system: macOS Mojave
Priority this issue should have – please be realistic and elaborate if possible: Somewhat important, as this completely stops the file from being sent
[x] I have also tested the issue on latest master, commit hash: https://github.com/discordjs/discord.js/commit/19ef45130b8d3a226500a0ccd69f7d90aaa02430