Skip to content

File

Implementation of Discord’s File component as a Luau builder. The URL must be an attachment:// reference pointing to an uploaded file.

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

File.url  :: string?

The attachment URL (must use attachment://filename format).

File.spoiler  :: boolean?

Whether the file is blurred as a spoiler.

File : setFile ( url )  -> File

Sets the attachment URL. Must use the attachment://filename format.

Parameters

url: string

Returns

File
File : setSpoiler ( spoiler )  -> File

Sets whether the file is blurred as a spoiler.

Parameters

spoiler: boolean

Returns

File
File : build ( )  -> JSON

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

Returns

JSON
File . new ( resource )  -> File

Responsible for creating a new File.

Parameters

resource: {
url: string?,
spoiler: boolean?,
}

Returns

File