K
Docs
API Reference→Pieces→Attach Image
📤

Attach Image

img.attachThe DarkroomImages

Attaches an image to whatever message you send next — Reply, Embed, Follow-up, Send, DM, or Update the Message all pick it up, just like buttons do. Add alt text for screen readers, or hide it behind a spoiler.

When to use this
  • →An Embed's image field can take {{card}} directly — no Attach needed
  • →Up to 10 images fit on one message

On the canvas

This is what Attach Image looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

📤
Attach Image
img.attach
Images
imagerequired
image…
fileName
rank-card
alt
A rank card for {{user.displayName}}
spoiler
boolean…
output
error

Config fields

FieldTypeReqWhat it does
imageimageyesImage 🖼️
fileName
rank-card
text—File name 📎
alt
A rank card for {{user.displayName}}
text—Alt text ♿
spoilerboolean—Spoiler 🙈

Output ports

outputIt goes out with the next message
errorNo image to attach
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
const file = new AttachmentBuilder(cardBuffer, {
  name: "rank-card.png",
  description: "A rank card for Kit",
});
// Staged now; sent with the next reply — embeds can use attachment://rank-card.png
await interaction.editReply({ files: [file] });