12 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!im struggling to add a local image file to my embed as a thumbnail
code and errors are shown
A URL can't contain spaces. Use
decodeURI
.updated code:
im still receiving the same errors π€
oh when i swapped
decodeURI
for encodeURI
it works now but for some reason its just posting the image as an attachment rather than making it the thumbnail of the embed π€
(this only happens when the file name has a space in it)You also need to encode the file name in the attachment.
like this?
or do you mean the actual
name:
part? if you do, then whats the purpose of that since its already being done in the .setThumbnail()
line
wait that doesnt even work
the code that i Only the actual name, encoding the file path will probably only cause issues.
The reason for this is that you need to provide the same name for the attachment and the reference for Discord to know that you want to reference the attachment.
ah i see
updated code
didnt
rip
hm
thanks for the help ig
i will wait to see if anyone else knows
im genuinely confused
cuz when the file name of the image is
Participation.png
it sends as a thumbnail
but if its Gold 1.png
it sends as an attachment π€Can you try
warRank.replaceAll(' ', '_')
? I believe that worked for me in the past, but I don't know for certain
For the name, not the file path (iirc, but worth trying for both separately/together)iβll try in the morning and let you know what happensπ
didnt work π€·ββοΈ
its fine tho i just changed all the file names
and added a
-
instead of the space
thanks everyone