API Reference

EmbedV2Builder

Builder for Discord Components V2 messages.

Overview

EmbedV2Builder builds Discord Components V2 messages — the new layout system that replaces classic embeds.

const embed = new EmbedV2Builder()
  .container({ accentColor: 0x5865F2 })
    .textDisplay("# Hello!")
  .end()
  .build()

await ctx.reply({ ...embed })
EmbedV2Builder is available globally — no import needed.

EmbedV2Builder

Root builder — top-level components go here.

Methods

MethodReturnsDescription
.container(opts?)ContainerBuilderAdd a container
.textDisplay(content)thisAdd a text display at root level
.separator(opts?)thisAdd a separator at root level
.mediaGallery(items)thisAdd a media gallery at root level
.actionRow()RootActionRowBuilderAdd an action row at root level
.build()objectBuild and return the message payload

.build()

Returns { flags: 32768, components: [...] } — spread it directly into your reply:

await ctx.reply({ ...embed.build() })

Throws if no components were added or if more than 25 components are present.


ContainerBuilder

Returned by .container(). Use .end() to return to EmbedV2Builder.

ContainerOptions

OptionTypeDescription
accentColornumberLeft border color as a number
spoilerbooleanBlur content until clicked

Methods

MethodReturnsDescription
.textDisplay(content)thisAdd markdown text
.separator(opts?)thisAdd a separator
.mediaGallery(items)thisAdd a media gallery
.file(url, spoiler?)thisAdd a file attachment
.section()SectionBuilderAdd a section
.actionRow()ActionRowBuilderAdd an action row
.end()EmbedV2BuilderClose the container and return to root
If theme.embedV2.footer.text is set in glyria.config.ts, a footer is automatically appended when .end() is called.

SectionBuilder

Returned by .section(). Pairs text with an accessory. Use .end() to return to ContainerBuilder.

Methods

MethodReturnsDescription
.textDisplay(content)thisAdd text (at least one required)
.buttonAccessory(opts)thisSet a button as accessory
.thumbnailAccessory(url, desc?)thisSet a thumbnail as accessory
.end()ContainerBuilderClose the section
A section requires at least one .textDisplay() and exactly one accessory. Missing either throws an error.

ActionRowBuilder

Returned by .actionRow() inside a container. Use .end() to return to ContainerBuilder.

Methods

MethodReturnsDescription
.button(opts)thisAdd a button
.end()ContainerBuilderClose the action row

RootActionRowBuilder

Returned by .actionRow() at root level. Use .end() to return to EmbedV2Builder.

Methods

MethodReturnsDescription
.button(opts)thisAdd a button
.end()EmbedV2BuilderClose the action row

ButtonOptions

OptionTypeDescription
labelstringButton text
customIdstringIdentifier for interaction — required for non-link buttons
stylestringButton style
urlstringURL — required for link style
emojiobjectButton emoji (name, id, animated)
disabledbooleanDisable the button

Button styles

StyleUse case
primaryMain action — requires customId
secondarySecondary action — requires customId
successPositive action — requires customId
dangerDestructive action — requires customId
linkExternal URL — requires url
premiumPremium upsell

SeparatorOptions

OptionTypeDescription
dividerbooleanShow a visible divider line
spacing"small" | "large"Spacing size

MediaGalleryItem

OptionTypeDescription
urlstringImage URL
descriptionstringCaption (optional)
spoilerbooleanBlur until clicked (optional)
Copyright © 2026