Yor.ts | classes/User
Class: User
Hierarchy
-
↳
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
Overrides
Defined in
Properties
API
• Private
API: UsersAPI
Defined in
CDN
• Private
CDN: CDN
Defined in
client
• client: YorClient
Inherited from
Defined in
raw
• raw: APIUser
Defined in
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
createdAt
▸ createdAt(): Date
Retrieves the creation date of the object.
Returns
The creation date of the object.
Defined in
createdTimestamp
▸ createdTimestamp(): number
Calculates the timestamp when this object was created.
Returns
number
The timestamp in milliseconds.
Defined in
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
getAvatarDecorationURL
▸ 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
getAvatarURL
▸ 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
getBannerURL
▸ 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
isBot
▸ isBot(): boolean
Checks if the user is a bot.
Returns
boolean
Whether the user is a bot.
Defined in
isSystem
▸ isSystem(): boolean
Checks if the user is a system user.
Returns
boolean
Whether the user is a system user.
Defined in
Was this page helpful?