Skip to content

SelectMenuDefaultValue

Implementation of discords DefaultValue object as a Luau builder.

https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure

SelectMenuDefaultValue.id  :: string

The id of the default value.

SelectMenuDefaultValue.type  :: SelectDefaultValueType

The type of the default value.

SelectMenuDefaultValue : setId ( id )  -> DefaultValue

Sets the id of the default value.

Parameters

id: string

Returns

DefaultValue
SelectMenuDefaultValue : setType ( type )  -> DefaultValue

Sets the type of the default value.

Parameters

type: SelectDefaultValueType

Returns

DefaultValue
SelectMenuDefaultValue : build ( )  -> JSON

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

Returns

JSON
SelectMenuDefaultValue . new ( resource )  -> DefaultValue

Responsible for creating a new DefaultValue.

local defaultValue = DefaultValue.new({
id = "123",
type = "user"
})

Parameters

resource: {
id: string,
type: apiTypes.SelectDefaultValueType,
}

Returns

DefaultValue