Preview environment

class AttachmentBuilder

export class AttachmentBuilder

Represents an attachment builder

Constructors

constructor()

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

Makes a new builder instance from a preexisting attachment structure.

setDescription(
description: string
) : this

Sets the description of this attachment.

Returns: This attachment

setFile(
attachment: BufferResolvable | Stream
name?: string
) : this

Sets the file of this attachment.

Returns: This attachment

setName(
name: string
) : this

Sets the name of this attachment.

Returns: This attachment

setSpoiler(
spoiler?: boolean
) : this

Sets whether this attachment is a spoiler

Returns: This attachment

toJSON() : unknown