class FileBuilder

declare class FileBuilder extends ComponentBuilder<APIFileComponent>

Constructors

constructor()

Creates a new file from API data.

protectedreadonly
data : Partial<APIFileComponent>

clearId() : this

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

Inherited from: ComponentBuilder

setId(
id: number
) : this

Sets the id of this component.

Inherited from: ComponentBuilder

setSpoiler(
spoiler?: boolean
) : this

Sets the spoiler status of this file.

setURL(
url: string
) : this

Sets the media URL of this file.

toJSON(
validationOverride?: boolean
) : APIFileComponent

Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.