Class: User
Hierarchy
-
Base
↳User
Table of contents
Constructors
Properties
Methods
- createDM
- createdAt
- createdTimestamp
- displayName
- getAvatarDecorationURL
- getAvatarURL
- getBannerURL
- isBot
- isSystem
Constructors
constructor
• new User(client
, data
): User
Constructor function.
Parameters
Name | Type | Description |
---|---|---|
client | YorClient | - |
data | APIUser | The data for the APIUser. |
Returns
User
Overrides
Base.constructorDefined in
src/structures/User.ts:21Properties
API
•Private
API: UsersAPI
Defined in
src/structures/User.ts:10CDN
•Private
CDN: CDN
Defined in
src/structures/User.ts:11client
• client:YorClient
Inherited from
Base.clientDefined in
src/structures/Base.ts:4raw
• raw:APIUser
Defined in
src/structures/User.ts:13Methods
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:34createdAt
▸ createdAt():Date
Retrieves the creation date of the object.
Returns
Date
The creation date of the object.
Defined in
src/structures/User.ts:99createdTimestamp
▸ createdTimestamp():number
Calculates the timestamp when this object was created.
Returns
number
The timestamp in milliseconds.
Defined in
src/structures/User.ts:85displayName
▸ 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:126getAvatarDecorationURL
▸ getAvatarDecorationURL(options?
): undefined
| string
Retrieves the URL of the avatar decoration based on the provided options.
Parameters
Name | Type | Description |
---|---|---|
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:68getAvatarURL
▸ getAvatarURL(options?
): undefined
| string
Generates the avatar URL for the user.
Parameters
Name | Type | Description |
---|---|---|
options? | Readonly <ImageURLOptions > | The options for generating the avatar URL. |
Returns
undefined
| string
The generated avatar URL.
Defined in
src/structures/User.ts:44getBannerURL
▸ getBannerURL(options?
): undefined
| string
Retrieves the URL for the banner image.
Parameters
Name | Type | Description |
---|---|---|
options? | Readonly <ImageURLOptions > | description of the options parameter |
Returns
undefined
| string
the URL for the banner image
Defined in
src/structures/User.ts:56isBot
▸ isBot():boolean
Checks if the user is a bot.
Returns
boolean
Whether the user is a bot.
Defined in
src/structures/User.ts:108isSystem
▸ isSystem():boolean
Checks if the user is a system user.
Returns
boolean
Whether the user is a system user.