> ## Documentation Index
> Fetch the complete documentation index at: https://yor.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Yor.ts | classes/User

[yor.ts](../README) / [Exports](../modules) / User

# Class: User

## Hierarchy

* [`Base`](Base)

  ↳ **`User`**

## Table of contents

### Constructors

* [constructor](User#constructor)

### Properties

* [API](User#api)
* [CDN](User#cdn)
* [client](User#client)
* [raw](User#raw)

### Methods

* [createDM](User#createdm)
* [createdAt](User#createdat)
* [createdTimestamp](User#createdtimestamp)
* [displayName](User#displayname)
* [getAvatarDecorationURL](User#getavatardecorationurl)
* [getAvatarURL](User#getavatarurl)
* [getBannerURL](User#getbannerurl)
* [isBot](User#isbot)
* [isSystem](User#issystem)

## Constructors

### constructor

• **new User**(`client`, `data`): [`User`](User)

Constructor function.

#### Parameters

| Name     | Type                     | Description               |
| :------- | :----------------------- | :------------------------ |
| `client` | [`YorClient`](YorClient) | -                         |
| `data`   | `APIUser`                | The data for the APIUser. |

#### Returns

[`User`](User)

#### Overrides

[Base](Base).[constructor](Base#constructor)

#### Defined in

[src/structures/User.ts:21](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L21)

## Properties

### API

• `Private` **API**: `UsersAPI`

#### Defined in

[src/structures/User.ts:10](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L10)

***

### CDN

• `Private` **CDN**: `CDN`

#### Defined in

[src/structures/User.ts:11](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L11)

***

### client

• **client**: [`YorClient`](YorClient)

#### Inherited from

[Base](Base).[client](Base#client)

#### Defined in

[src/structures/Base.ts:4](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/Base.ts#L4)

***

### raw

• **raw**: `APIUser`

#### Defined in

[src/structures/User.ts:13](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L13)

## Methods

### createDM

▸ **createDM**(): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIChannel`>

Creates a direct message channel.

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`APIChannel`>

A promise that resolves to the created direct message channel.

#### Defined in

[src/structures/User.ts:34](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L34)

***

### createdAt

▸ **createdAt**(): [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date)

Retrieves the creation date of the object.

#### Returns

[`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date)

The creation date of the object.

#### Defined in

[src/structures/User.ts:99](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L99)

***

### createdTimestamp

▸ **createdTimestamp**(): `number`

Calculates the timestamp when this object was created.

#### Returns

`number`

The timestamp in milliseconds.

#### Defined in

[src/structures/User.ts:85](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L85)

***

### 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](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L126)

***

### getAvatarDecorationURL

▸ **getAvatarDecorationURL**(`options?`): `undefined` | `string`

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

#### Parameters

| Name       | Type                                                                                                               | Description                            |
| :--------- | :----------------------------------------------------------------------------------------------------------------- | :------------------------------------- |
| `options?` | [`Readonly`](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype)\<`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](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L68)

***

### getAvatarURL

▸ **getAvatarURL**(`options?`): `undefined` | `string`

Generates the avatar URL for the user.

#### Parameters

| Name       | Type                                                                                                           | Description                                |
| :--------- | :------------------------------------------------------------------------------------------------------------- | :----------------------------------------- |
| `options?` | [`Readonly`](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype)\<`ImageURLOptions`> | The options for generating the avatar URL. |

#### Returns

`undefined` | `string`

The generated avatar URL.

#### Defined in

[src/structures/User.ts:44](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L44)

***

### getBannerURL

▸ **getBannerURL**(`options?`): `undefined` | `string`

Retrieves the URL for the banner image.

#### Parameters

| Name       | Type                                                                                                           | Description                          |
| :--------- | :------------------------------------------------------------------------------------------------------------- | :----------------------------------- |
| `options?` | [`Readonly`](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype)\<`ImageURLOptions`> | description of the options parameter |

#### Returns

`undefined` | `string`

the URL for the banner image

#### Defined in

[src/structures/User.ts:56](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L56)

***

### 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](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L108)

***

### 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](https://github.com/OreOreki/yor.ts/blob/ff21935/src/structures/User.ts#L117)
