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
d.js toolkit
d.js toolkit2y ago
- 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!
5UP3R_D1N
5UP3R_D1NOP2y ago
well i cant send the code ig i will send the whole bot (theres nothing much)
5UP3R_D1N
5UP3R_D1NOP2y ago
wait
5UP3R_D1N
5UP3R_D1NOP2y ago
i get this error from error.rawError.errors.attachments["0"].id._errors
5UP3R_D1N
5UP3R_D1NOP2y ago
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)
d.js docs
d.js docs2y ago
To share long code snippets use a service like gist, sourcebin, starbin, or similar instead of posting them as large code blocks.
5UP3R_D1N
5UP3R_D1NOP2y ago
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:)
5UP3R_D1N
5UP3R_D1NOP2y ago
5UP3R_D1N
5UP3R_D1NOP2y ago
(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!
Want results from more Discord servers?
Add your server