Skip to content

Section

Implementation of Discord’s Section component as a Luau builder. Sections lay out 1-3 text/button components with an optional right-side accessory.

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

Section.components  :: JSON }

The child components. Maximum 3.

Section.accessory  :: JSON | nil

The right-side accessory component.

Section : addComponent ( component )  -> Section

Adds a text display or button component. Maximum 3 components.

Parameters

component: ButtonComponentObject

Returns

Section
Section : setAccessory ( accessory )  -> Section

Sets the right-side accessory. Can be a thumbnail or button.

Parameters

accessory: ButtonComponentObject

Returns

Section
Section : build ( )  -> JSON

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

Returns

JSON
Section . new ( )  -> Section

Responsible for creating a new Section.

Returns

Section