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

duration : number | null

The duration of the attachment in seconds This is only for voice message attachments.

name : string | null

The name of this attachment

readonly
spoiler : boolean

Whether or not this attachment has been marked as a spoiler

title : string | null

The title of the attachment

waveform : string | null

The base64 encoded byte array representing a sampled waveform This is only for voice message attachments.

Makes a new builder instance from a preexisting attachment structure.

setDescription(
description: string
) : this

Sets the description of this attachment.

Returns: This attachment

setDuration(
duration: number
) : this

Sets the duration of this attachment. This is only for voice message attachments.

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 = true
) : this

Sets whether this attachment is a spoiler

Returns: This attachment

setTitle(
title: string
) : this

Sets the title of this attachment.

Returns: This attachment

setWaveform(
waveform: string
) : this

Sets the waveform of this attachment. This is only for voice message attachments.

Returns: This attachment

toJSON() : unknown