class AttachmentBuilder
implements
JSONEncodable<RESTAPIAttachment>export declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment>A builder that creates API-compatible JSON data for attachments.
Converts this attachment to a RawFile for uploading.
Returns: A RawFile object, or undefined if no file data is set
setDescription(description: string) : this
description: string
Sets the description of this attachment.
setDuration(duration: number) : this
duration: number
Sets the duration of this attachment (audio clips).
setFileContentType(contentType: string) : this
contentType: string
Sets the content type of the file data to upload with this attachment.
setFileData(data: Buffer | Uint8Array | string) : this
data: Buffer | Uint8Array | string
Sets the file data to upload with this attachment.
setFilename(filename: string) : this
filename: string
Sets the filename of this attachment.
setTitle(title: string) : this
title: string
Sets the title of this attachment.
setWaveform(waveform: string) : this
waveform: string
Sets the waveform of this attachment (audio clips).
toJSON(validationOverride?: boolean) : RESTAPIAttachment
validationOverride?: boolean
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.