Preview environment

class FileBuilder

external
declare class FileBuilder extends ComponentBuilder<APIFileComponent>

Constructors

constructor()

Creates a new file from API data.

readonlyexternal
data : Partial<APIFileComponent>

The API data associated with this component.

Inherited from: ComponentBuilder

external
clearId() : this

Clears the id of this component, defaulting to a default incremented id.

Inherited from: ComponentBuilder

external
setId(
id: number
) : this

Sets the id (not the custom id) for this component.

Inherited from: ComponentBuilder

external
setSpoiler(
spoiler?: boolean
) : this

Sets the spoiler status of this file.

external
setURL(
url: string
) : this

Sets the media URL of this file.

external
toJSON() : APIFileComponent

Serializes this builder to API-compatible JSON data.