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
Summary
Properties
Container.components :: { any }Container.accentColor :: number?Container.spoiler :: boolean?Methods
Container:addComponent(component: apiTypes.ComponentObjects) → ContainerContainer:setAccentColor(accentColor: number) → ContainerContainer:setSpoiler(spoiler: boolean) → ContainerContainer:build() → JSONFunctions
Container.new() → ContainerProperties
Section titled “Properties”components
Section titled “components”The child components. Maximum 40 total.
accentColor
Section titled “accentColor”Hex color integer for the left border accent.
spoiler
Section titled “spoiler”Whether the container contents are blurred as a spoiler.
Methods
Section titled “Methods”addComponent
Section titled “addComponent”Container : addComponent ( component ) -> Container
Adds a child component. Maximum 40 total components.
Parameters
| component: ComponentObjects |
Returns
| Container |
setAccentColor
Section titled “setAccentColor”Container : setAccentColor ( accentColor ) -> Container
Sets the accent color for the left border as a hex color integer.
Parameters
| accentColor: number |
Returns
| Container |
setSpoiler
Section titled “setSpoiler”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 |
Functions
Section titled “Functions”Container . new ( ) -> Container
Responsible for creating a new Container.
Returns
| Container |