Components V2
Learn more about how to use the newly added Components V2.
Replace [prefix] with your server's prefix. Components V2 is Discord's new layout system - it lets you build rich messages with containers, text blocks, buttons, and more.
You can use [prefix]embedsetup to easily generate scripts that are compatible with Serenity.
How It Works
Components V2 scripts start with {components} instead of {embed}. Each block is separated by $v and wrapped in curly braces.
// Basic format
{components}$v{block}$v{block}$v{block}
You cannot mix {embed} and {components} in the same script. Use one or the other.
Containers
Containers wrap your content in a styled box with an optional colored side bar. Everything between {container} and {/container} goes inside it.
// Syntax
{components}$v{container: color:#HEX}$v{...blocks...}$v{/container}
// Example - dark container with colored accent
{components}$v{container: color:#5865F2}$v{text: Hello World!}$v{/container}
Container Options
| Option | Description | Example |
|---|---|---|
color:#HEX | Accent color (side bar) | color:#5865F2 |
spoiler | Marks the container as spoiler | color:#FF0000 && spoiler |
Multiple options are separated with &&.
Text Displays
Text blocks support full Discord markdown - bold, italic, headers, mentions, and more.
// Simple text
{components}$v{container: color:#2b2d31}$v{text: Welcome to the server!}$v{/container}
// Markdown headers
{components}$v{container: color:#2b2d31}$v{text: ### Welcome}$v{text: Thanks for joining!}$v{/container}
Separators
Separators add a horizontal divider between blocks.
// Normal separator
$v{separator}
// Large separator (more spacing)
$v{separator: large}
Example
{components}$v{container: color:#2b2d31}$v{text: ### Rules}$v{separator}$v{text: 1. Be respectful}$v{/container}
Buttons
Buttons support labels, URLs, emojis, and color styles. Buttons are automatically wrapped in a row - you don't need to add {row} manually.
// Syntax
$v{button: label:TEXT && url:URL && style:COLOR && emoji:EMOJI}
// Link button
$v{button: label:Join Server && url:https://discord.gg/example}
// Styled button with emoji
$v{button: label:Click Me && url:https://example.com && style:green && emoji:🎉}
Button Styles
| Style | Color |
|---|---|
blue | Blurple |
green | Green |
gray | Gray |
red | Red |
Buttons Inside Containers
Place the button before {/container} to put it inside the container:
// Button INSIDE the container
{components}$v{container: color:#030303}$v{text: Click below!}$v{button: label:Open && url:https://example.com}$v{/container}
// Button OUTSIDE the container
{components}$v{container: color:#030303}$v{text: Hello}$v{/container}$v{button: label:Open && url:https://example.com}
Multiple buttons next to each other are merged into a single row automatically (max 5 per row).
Sections
Sections display text with an optional thumbnail accessory.
// Example
$v{section: Welcome to the server! && thumbnail:{user.avatar}}
Media Gallery
Display one or more images in a gallery layout.
// Single image
$v{gallery: https://example.com/image.png}
// Multiple images
$v{gallery: https://example.com/one.png && https://example.com/two.png}
Action Rows
If you need explicit control over button grouping, use {row} and {/row}:
// Two separate rows of buttons
{components}$v{container: color:#2b2d31}$v{text: Pick a color}$v{row}$v{button: label:Red && url:https://example.com && style:red}$v{button: label:Blue && url:https://example.com && style:blue}$v{/row}$v{/container}
Without {row}, consecutive buttons are automatically grouped together.
Content (Plain Text)
Send plain text above or alongside your components:
$v{content: This text appears above the components}
Variables
All standard embed variables work inside component scripts:
| Variable | Description |
|---|---|
{user} | Username |
{user.mention} | User mention |
{user.name} | Username |
{user.id} | User ID |
{user.avatar} | User avatar URL |
{user.joined_at} | Join date (relative) |
{user.created_at} | Account age (relative) |
{guild.name} | Server name |
{guild.count} | Member count |
{guild.id} | Server ID |
{guild.icon} | Server icon URL |
{guild.boost_count} | Boost count |
{guild.booster_count} | Booster count |
{guild.boost_tier} | Boost tier |
{guild.vanity} | Vanity URL |
{invisible} | Invisible color hex |
{botcolor} | Bot theme color hex |
{botavatar} | Bot avatar URL |
Full Examples
Welcome Message
{components}$v{container: color:#5865F2}$v{text: ### Welcome to {guild.name}!}$v{separator}$v{section: Hey {user.mention}, you're member **#{guild.count}**! && thumbnail:{user.avatar}}$v{button: label:Rules && url:https://discord.com/channels/123/456 && style:blue}$v{/container}
Kick DM
{components}$v{container: color:#030303}$v{text: Kicked from {guild.name}}$v{separator}$v{text: You've been kicked from **{guild.name}** for: {reason}}$v{button: label:Appeal && url:https://discord.gg/example}$v{/container}
Info Card
{components}$v{container: color:#2b2d31}$v{text: ### Server Info}$v{separator}$v{text: **Members:** {guild.count}}$v{text: **Boosts:** {guild.boost_count}}$v{text: **Tier:** {guild.boost_tier}}$v{/container}
Where Can I Use Components V2?
Components V2 scripts work anywhere you can use embed scripts:
[prefix]welcome add/[prefix]leave add[prefix]joindm add[prefix]boost message- Invoke embeds (
[prefix]invoke kick/[prefix]invoke ban/ etc.) - Autoresponders
- Webhooks