AttachmentBuilder

export class AttachmentBuilder
export class AttachmentBuilder
Represents an attachment builder
constructor(attachment, data?)
NameTypeOptionalDescription
attachmentBufferResolvable | StreamNoNone
dataAttachmentDataYesNone
attachment:BufferResolvable | Stream
The file associated with this attachment.
description:string | null
The description of the attachment
name:string | null
The name of this attachment
Readonly
spoiler:boolean
Whether or not this attachment has been marked as a spoiler
Static
from(other):AttachmentBuilder
Makes a new builder instance from a preexisting attachment structure.
NameTypeOptionalDescription
otherJSONEncodable<AttachmentPayload>NoThe builder to construct a new instance from
setDescription(description):this
Sets the description of this attachment.
Returns
This attachment
NameTypeOptionalDescription
descriptionstringNoThe description of the file
setFile(attachment, name?):this
Sets the file of this attachment.
Returns
This attachment
NameTypeOptionalDescription
attachmentBufferResolvable | StreamNoThe file
namestringYesNone
setName(name):this
Sets the name of this attachment.
Returns
This attachment
NameTypeOptionalDescription
namestringNoThe name of the file
setSpoiler(spoiler?):this
Sets whether this attachment is a spoiler
Returns
This attachment
NameTypeOptionalDescription
spoilerbooleanYesWhether the attachment should be marked as a spoiler
toJSON():unknown