Embeds
Embeds are rich cards attached to a message:
import { EmbedBuilder } from '@zaun/bot';
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' }), ],});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 |
- Pictures (image, thumbnail, author and footer icons) are attachments of the same message,
never URLs. Upload them first (needs the
attachmentscapability):bot.messages.upload(..)in TypeScript,zaun_bot::messages::uploadin Rust; thensetImage(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_LINKSpermission.