Skip to content

Container

Implementation of Discord’s Container component as a Luau builder. Containers are top-level wrappers for Components V2 layouts. Requires the IS_COMPONENTS_V2 message flag (bit 15) to be set.

https://discord.com/developers/docs/components/reference#container

Container.components  :: { any }

The child components. Maximum 40 total.

Container.accentColor  :: number?

Hex color integer for the left border accent.

Container.spoiler  :: boolean?

Whether the container contents are blurred as a spoiler.

Container : addComponent ( component )  -> Container

Adds a child component. Maximum 40 total components.

Parameters

component: ComponentObjects

Returns

Container
Container : setAccentColor ( accentColor )  -> Container

Sets the accent color for the left border as a hex color integer.

Parameters

accentColor: number

Returns

Container
Container : setSpoiler ( spoiler )  -> Container

Sets whether the container contents are blurred as a spoiler.

Parameters

spoiler: boolean

Returns

Container
Container : build ( )  -> JSON

Responsible for building the Container JSON that can be parsed by the Discord API.

Returns

JSON
Container . new ( )  -> Container

Responsible for creating a new Container.

Returns

Container