Modal
Implementation of discords Modal object as a Luau builder.
Summary
Properties
Modal.customId :: string?Modal.title :: string?Modal.components :: { Builders.Message.TextInput }?Properties
Section titled “Properties”customId
Section titled “customId”The custom identifier for the modal.
The title that appears at the top of the modal.
components
Section titled “components”The components that will be displayed in this modal.
Methods
Section titled “Methods”setCustomId
Section titled “setCustomId”Modal : setCustomId ( customId ) -> Modal
Sets the custom ID for this modal. This is required for the Discord API to identify this modal.
Parameters
| customId: string |
Returns
| Modal |
setTitle
Section titled “setTitle”Modal : setTitle ( title ) -> Modal
Sets the title that appears at the top of the modal.
Parameters
| title: string |
Returns
| Modal |
setComponents
Section titled “setComponents”Modal : setComponents ( components ) -> Modal
Sets the components that will be displayed in this modal. These must be text input components.
Parameters
| components: JSON } |
Returns
| Modal |
addLabel
Section titled “addLabel”Modal : addLabel ( labelComponent ) -> Modal
Adds a Label component to the modal. Labels are the recommended replacement for ActionRow in modals.
Parameters
| labelComponent: JSON |
Returns
| Modal |
Modal : build ( ) -> JSON
Responsible for building the Modal JSON that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”Modal . new ( resource ) -> Modal
Responsible for creating a new Modal.
local modal = Modal.new() :setCustomId("my-modal") :setTitle("My Modal") :setComponents({textInput}) :build()Parameters
| resource: { customId: string?, title: string?, components: { textInput.JSON, } |
Returns
| Modal |