Attached image sending before embed? Not within
Why is this happening?
11 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!But other times, this happens:
In both cases, I am differing the response to give the code time to generate the graph then editing the response, once the data is ready.
Show your code!
This might have to do with discord filename sanitization
I don't remember the specifics but try using the user's id instead of username in your filenames
It is being sent as a file and within the Embed from what the code shows. In the setImage and in the files part of the reply
It's only being sent once, when it is included in the
files
array in the editReply
call. The setImage
tells Discord to look for an attachment with that filename, but it doesn't attach the file.Ah its my bad, although I don't recall it always being like that from my past usage of canvas with DJS but as plastic suggested, it could be relating to the filename
This seems to have fixed it, what exactly is filename sanitization?
discord autochanging filenames after you upload them, before displaying the message to users
which breaks the attachment:// link