UtilitiesDocs

Scripting

Container Code

Build a message from Discord's newer components, like a box with a colored bar.

#Structure

Start with {cv2}, then add components with $v between them. Each one is written {name: …}, and the parts inside one are separated by &&. Variables work anywhere, links included.

{cv2}$v{component}$v{component}

{cv2} makes the whole message components, so it can't carry an embed as well.

#Components

Each goes in the message, or inside a container.

Container

A box with a colored bar down the side, holding other components. Only in the message, not inside another container.

  • accent - The bar's color, as a hex code. Optional
  • spoiler - Blurs the box until it's clicked, with true. Optional
{container: accent: color && spoiler: true && {component} && {component}}
Text

Words, with Discord's markdown: ## heading, **bold**, -# small text and the rest.

{text: words}
Section

Up to three lines of text with a picture or a button beside them. Without either, it's sent as plain text.

{section: {text: words} && {thumbnail: link}}
{section: {text: words} && {button: …}}
Gallery

Up to 10 pictures, separated by &&. After a picture, description: adds the text screen readers say, and spoiler blurs it.

{gallery: link && description: words && spoiler && link}
Separator

A line between components. large makes the gap bigger, and divider: false leaves out the line.

{separator}
{separator: divider: false && spacing: large}
Action row

A row of up to 5 quick buttons: links, or colored buttons that do nothing when pressed. One {button: …} on its own is a row of one.

{actionrow: {button: …} && {button: …}}
Select

A dropdown of up to 25 options, shown greyed out: it lists choices, but nobody can pick one.

{select: placeholder: words && option && option}

#Example

A welcome card: the member's name and avatar, the server's banner, and a link.

{cv2}$v{container: accent: #5865F2 && {section: {text: ## Welcome, {user.name}!} && {text: You're member number {guild.count}.} && {thumbnail: {user.avatar}}} && {separator} && {gallery: {guild.banner}} && {actionrow: {button: https://utilities.best && Website}}}

#Frequently asked questions

Where can I use container code?

In every message you write for the bot: welcome, leave and boost messages, autoresponders, sticky messages, button replies and /send. Reply styles in /customize feedback use it too, without {cv2}.

Can I use saved embeds, saved buttons or button code in it?

No. {embed:name}, {button:name} and {button}$v aren't read in container code and show as text. The only buttons are quick buttons.

Why is part of my message missing?

Anything that can't be drawn is left out, and the rest is sent: a name it doesn't know, a container inside another, a link that doesn't start with https:// or http://, and anything past Discord's limit of 40 components in one message.

Can I save one in the embed editor?

No. The embed editor holds embeds, so container code pasted there is turned into a plain embed.

Can I paste code from another bot?

Mostly. These names are read as well: description or content for text, image or media for gallery, divider for separator, buttons for actionrow, dropdown for select, and color for accent. Anything it can't draw is left out.

How do I get the code of a message I already have?

Give a link to a message in your server. A message built from components comes back as container code.

,autoresponder code (trigger)