AttachmentBuilder

export declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment>
export declare class AttachmentBuilder implements JSONEncodable<RESTAPIAttachment>
A builder that creates API-compatible JSON data for attachments.
constructor(data?)
Creates a new attachment builder from API data.
NameTypeOptionalDescription
dataPartial<RESTAPIAttachment>Yes
The API data to create this attachment builder with
clearDescription():this
Clears the description of this attachment.
clearDuration():this
Clears the duration of this attachment.
clearFilename():this
Clears the filename of this attachment.
clearTitle():this
Clears the title of this attachment.
clearWaveform():this
Clears the waveform of this attachment.
setDescription(description):this
Sets the description of this attachment.
NameTypeOptionalDescription
descriptionstringNo
The description of the attachment
setDuration(duration):this
Sets the duration of this attachment (audio clips).
NameTypeOptionalDescription
durationnumberNo
The duration of the attachment in seconds
setFilename(filename):this
Sets the filename of this attachment.
NameTypeOptionalDescription
filenamestringNo
The filename of the attachment
setId(id):this
Sets the id of the attachment.
NameTypeOptionalDescription
idSnowflakeNo
The id of the attachment
setTitle(title):this
Sets the title of this attachment.
NameTypeOptionalDescription
titlestringNo
The title of the attachment
setWaveform(waveform):this
Sets the waveform of this attachment (audio clips).
NameTypeOptionalDescription
waveformstringNo
The waveform of the attachment
toJSON(validationOverride?):RESTAPIAttachment
Serializes this builder to API-compatible JSON data.
Note that by disabling validation, there is no guarantee that the resulting object will be valid.
NameTypeOptionalDescription
validationOverridebooleanYes
Force validation to run/not run regardless of your global preference