MediaGalleryBuilder() error.
I've been encountering this error in which I pass the
attachment://file.png
in the MediaGalleryBuilder().media.url and send the AttachmentBuilder() in the files array, but it still outputs the error of it not encountering the file sent.
As of now, the code is quite unpolished and really scraped on for "testing purposes", but it should work just fine; but, it doesn't.
9 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!And this is the class getComponent() method:
As I said, the code its pretty raw as of now, but the methods should output no error at all.
This is the AttachmentBuilder's console.log().
And this is the error I've been getting:
Uncaught exception: DiscordAPIError[50035]: Invalid Form Body
components[0].components[1].items[0].media.url[UNFURLED_MEDIA_ITEM_REFERENCED_ATTACHMENT_NOT_FOUND]: The referenced attachment ("attachment://votación.png") was not found
Whenever I crtl + click the file link it outputs in the terminal, it sends me to the actual file, so I really don't know why this is failing. I've also tried this method in another file, and worked just fine.
This is the one that works:
The rules embed constructor gets as a first arg the actual timestamp to place it at the message, then the second arg is placed in mediagallery's media.url property exactly as it's passed in the constructor.
This is the preview of the working one.

sorry this comes off as mean but This code is nonsense
StartUpEmbed
is not a builder ins d.js. also you dont need the MessageFlags.SuppressEmbeds
because cv2 disables embed
Take a look at the exampleNo, I'm building them as classes for them to be reusable later on. Those classes use d.js builders.
ya got it, sorry about that
For example
And within, I use the d.js Builders.
dw
Work to understand your error but the the
MessageFlags.SuppressEmbeds
thing is still trueI get that the code may seem sketchy and bad written, but technically the data that is being posted to discord to send to the channel is valid. Though it does not recognize the attachment.
Oh, oke, ty
I used it as a precaution, never really had it embed it b4.
See how in the terminal it shows the AttachmentBuilder work well but when sent, just randomly breaking.