Can't send attachment from buffer
i made a bot that preview STL files, but got an error when trying to send the message, Code and error is below
10 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!well
i cant send the code
ig
i will send the whole bot
(theres nothing much)
wait
i get this error from error.rawError.errors.attachments["0"].id._errors
it said i need to put id
which this is buffer bruh
i dont know whats going on
please do not mention my skill issue on
Object.values(GatewayIntentBits)
a
ok this time not codeboard
https://sourceb.in/jaMNzZEA5K
i need to pass buffer to files array first?
but it also contain attachment from user
should i keep that attachment on attachments and move buffer to files?
so i should convert both to files, but how?
(i always use attachments)
so not much changes needed
what syntax do i use for files:?
i changed to files and got 1 to work, but the thumbnail doesnt come up("thumbnail" from files:)
(the name is generated by tinkercad, not me)
;-;
fetch have only .arrayBuffer(), which i convert it into buffer, and in attachmentbuilder, .toBuffer() somehow return arrayBuffer instead
stl did render without error, so i guess the fetch's conversion is fine
i got it to work by adding extension to the image! tysm again!