Skip to main content
Version: 0.9.0

Class: Attachment

The base class for all structures.

Extends​

Constructors​

Constructor​

new Attachment(client, data): Attachment

Parameters​

ParameterType
clientClient
data{ }

Returns​

Attachment

Overrides​

Base.constructor

Properties​

cachedAt​

cachedAt: number

Inherited from​

Base.cachedAt


client​

protected readonly client: Client

Inherited from​

Base.client


contentType​

contentType: string


deleted?​

optional deleted?: boolean


filename​

filename: string


id​

id: string

Overrides​

Base.id


messageId?​

optional messageId?: string | null


metadata​

metadata: AttachmentMetadata


objectId?​

optional objectId?: string | null


reported?​

optional reported?: boolean


serverId?​

optional serverId?: string | null


size​

size: number


tag​

tag: string


userId?​

optional userId?: string | null

Accessors​

isImage​

Get Signature​

get isImage(): boolean

Helper boolean to quickly check if it's an image

Returns​

boolean


url​

Get Signature​

get url(): string

Automatically constructs the direct CDN URL for this file

Returns​

string

Methods​

_clone()​

_clone(): this

Helper to quickly clone a structure

Returns​

this

Inherited from​

Base._clone


equals()​

equals(other): boolean

Compares this object with another to see if they represent the same entity.

Parameters​

ParameterType
otherstring | Base

Returns​

boolean

Inherited from​

Base.equals


toString()​

toString(): string

Returns the UUID string when the object is cast to a string.

Returns​

string

Inherited from​

Base.toString