Loading

Back to Home

$addContainer

$addContainer creates a container component. A container is a top-level component that groups other components together. Containers can hold $addSection, $addActionRow, $addMediaGallery, $addTextDisplay, and $addSeparator.

Syntax

$addContainer[ID;(Color;Spoiler)]

What happens

  1. $addContainer creates a container with the given ID.
  2. Other components that reference that ID are placed inside it.
  3. The container groups those components visually in the message.

Example 1: Basic container

Create a container and put a text display inside it:

$addContainer[main]
$addTextDisplay[Welcome to the server!;main]
Result: Basic container example

What happens:

  1. $addContainer creates a container named main.
  2. $addTextDisplay attaches its text to that container.
  3. The message shows the text grouped inside the container.

To add more components, reference the same container ID. See $addTextDisplay for details.

Example 2: Container with a color

Create a red container:

$addContainer[panel;ff0000]
$addTextDisplay[This is a red container;panel]
Result: Red container example

What happens:

  1. $addContainer creates a container with a red border/background.
  2. $addTextDisplay adds text inside that container.

The color applies to the whole container. Components inside it share the container's visual grouping.

Common uses

See also