Skip to content

Attachments

Creating attachments

The Attachment component is really simple to use, it just gets either a file or a path and returns a LilybirdAttachment.

import { Attachment } from "@lilybird/jsx";
import { join } from "node:path"
const att = <Attachment
path={join(import.meta.dir, "./lilybird.png")}
name="lilybird"
/>;

Using attachments

When using the the Attachment component you can easily pass in <Attachment>.uri to embeds and other places that use the URI form of attachments.

An example would be:

import { Attachment, Embed, EmbedImage } from "@lilybird/jsx";
import { join } from "node:path"
const att = <Attachment
path={join(import.meta.dir, "./lilybird.png")}
name="lilybird"
/>;
const embed = (
<Embed title="Lilybird" description="For bun, with bun">
<EmbedImage url={att.uri} />
</Embed>
);