Skip to content

Field

Implementation of discords Field object as a Luau builder.

https://discord.com/developers/docs/resources/message#embed-object-embed-field-structure

Field.name  :: string?

The name of the field that is displayed.

Field.value  :: string?

The value of the field that is displayed.

Field.inline  :: boolean?

Whether or not this field should display inline.

Field : setName ( name )  -> Field

Set the name of the field

Parameters

name: string

Returns

Field
Field : setValue ( value )  -> Field

Set the value of the field

Parameters

value: string

Returns

Field
Field : setIsInline ( isInline )  -> Field

Set if the field is inline.

Parameters

isInline: boolean

Returns

Field
Field : build ( )  -> JSON

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

Returns

JSON
Field . new ( resource )  -> Field

Responsible for creating a new Field.

Parameters

resource: {
name: string?,
value: string?,
inline: boolean?,
}

Returns

Field