Send Attachment

const attachment = new discord.AttachmentBuilder()
.setFile(Canvas.toBuffer())
.setName('profileMember.png');

await interaction.channel.send({attachments: [attachment]});
const attachment = new discord.AttachmentBuilder()
.setFile(Canvas.toBuffer())
.setName('profileMember.png');

await interaction.channel.send({attachments: [attachment]});
DiscordAPIError[50035]: Invalid Form Body
attachments[0].id[BASE_TYPE_REQUIRED]: This field is required
DiscordAPIError[50035]: Invalid Form Body
attachments[0].id[BASE_TYPE_REQUIRED]: This field is required
help pls...
3 Replies
d.js toolkit
d.js toolkit7mo 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! - Marked as resolved by OP
xx_lavaboy_xx123
the option is called files not attachments there's attachments but its used for smth else
vanillop 🖤
vanillop 🖤OP7mo ago
omg thx
Want results from more Discord servers?
Add your server