yor.ts / Exports / User

Class: User

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new User(client, data): User

Constructor function.

Parameters

NameTypeDescription
clientYorClient-
dataAPIUserThe data for the APIUser.

Returns

User

Overrides

Base.constructor

Defined in

src/structures/User.ts:21

Properties

API

Private API: UsersAPI

Defined in

src/structures/User.ts:10


CDN

Private CDN: CDN

Defined in

src/structures/User.ts:11


client

client: YorClient

Inherited from

Base.client

Defined in

src/structures/Base.ts:4


raw

raw: APIUser

Defined in

src/structures/User.ts:13

Methods

createDM

createDM(): Promise<APIChannel>

Creates a direct message channel.

Returns

Promise<APIChannel>

A promise that resolves to the created direct message channel.

Defined in

src/structures/User.ts:34


createdAt

createdAt(): Date

Retrieves the creation date of the object.

Returns

Date

The creation date of the object.

Defined in

src/structures/User.ts:99


createdTimestamp

createdTimestamp(): number

Calculates the timestamp when this object was created.

Returns

number

The timestamp in milliseconds.

Defined in

src/structures/User.ts:85


displayName

displayName(): string

The global name of this user, or their username if they don’t have one

Returns

string

The global name of this user

Defined in

src/structures/User.ts:126


getAvatarDecorationURL

getAvatarDecorationURL(options?): undefined | string

Retrieves the URL of the avatar decoration based on the provided options.

Parameters

NameTypeDescription
options?Readonly<BaseImageURLOptions>The options for the avatar decoration.

Returns

undefined | string

The URL of the avatar decoration, or undefined if it is not available.

Defined in

src/structures/User.ts:68


getAvatarURL

getAvatarURL(options?): undefined | string

Generates the avatar URL for the user.

Parameters

NameTypeDescription
options?Readonly<ImageURLOptions>The options for generating the avatar URL.

Returns

undefined | string

The generated avatar URL.

Defined in

src/structures/User.ts:44


getBannerURL

getBannerURL(options?): undefined | string

Retrieves the URL for the banner image.

Parameters

NameTypeDescription
options?Readonly<ImageURLOptions>description of the options parameter

Returns

undefined | string

the URL for the banner image

Defined in

src/structures/User.ts:56


isBot

isBot(): boolean

Checks if the user is a bot.

Returns

boolean

Whether the user is a bot.

Defined in

src/structures/User.ts:108


isSystem

isSystem(): boolean

Checks if the user is a system user.

Returns

boolean

Whether the user is a system user.

Defined in

src/structures/User.ts:117