#DM user using rest and include file attachment in the embed

24 messages · Page 1 of 1 (latest)

sand cedarBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
shell pendant
#

i dont think thats how you add thumbnails

candid path
#

I think your attachment name needs to be description rather the filename however I am not 100% sure on that

#

No nvm

#

Idk tbh

#

Best thing to do is to log what goes in there

#

You also don’t add a content type which I’m also not sure if that makes a difference

#

`Using Attachments within Embeds

You can upload attachments when creating a message and use those attachments within your embed. To do this, you will want to upload files as part of your multipart/form-data body. Make sure that you're uploading files which contain a filename, as you will need to reference it in your payload.`

#

You didn’t add any headers

#

This is rest, not djs

#

body: {},
headers: { “Content-Type: “…” }

candid path
#

Yh that’s not how that works

#

It’s just “Content-Type”: “multi form/…”

#

Without the boundary stuff

#

Yes

#

I think

#

Well, ok. Is the body and the files put correctly?

#

body: { stuff }

#

You’ll want body: body then

#

I imagine

#

Can you log what you put in there please

#

And updated code will be nice

#

I’ll need to look when I’m home