# Embeds

> Rich embed cards in bot messages, their limits, and the rules for pictures and links.

Embeds are rich cards attached to a message:

**TypeScript:**

```ts

interaction.reply({
  embeds: [
    new EmbedBuilder()
      .setTitle('Build #412 passed')
      .setURL('https://ci.example.org/412')
      .setDescription('All 1 204 tests green.')
      .setColor(0x2ecc71)
      .addFields(
        { name: 'Duration', value: '6 min', inline: true },
        { name: 'Commit', value: '`995900c`', inline: true },
      )
      .setFooter({ text: 'CI bot' }),
  ],
});
```

**Rust:**

```rust
let _ = ctx.reply(
    EmbedBuilder::new()
        .title("Build #412 passed")
        .url("https://ci.example.org/412")
        .description("All 1 204 tests green.")
        .color(0x2ECC71)
        .field("Duration", "6 min", true)
        .field("Commit", "`995900c`", true)
        .footer("CI bot"),
);
```

| Field | Limit |
|---|---|
| title | ≤ 256 |
| description | ≤ 4 096 |
| fields | ≤ 25; name ≤ 256, value ≤ 1 024 |
| author name / footer text | ≤ 256 / ≤ 2 048 |
| per message | ≤ 10 embeds, ≤ 6 000 characters of text in all |

## Rules

- **Pictures** (image, thumbnail, author and footer icons) are **attachments of the same message**,
  never URLs. Upload them first (needs the `attachments` capability): `bot.messages.upload(..)` in
  TypeScript, `zaun_bot::messages::upload` in Rust; then `setImage(attachmentId)`.
- **Links** are `https://` only, with no user name or password, and open only when clicked.
- An embed must show something: a title, description, author, footer, picture or field.
- Embeds need the `EMBED_LINKS` permission.
