Class: User
The base class for all structures.
Extends
Extended by
Constructors
Constructor
new User(
client,data):User
Parameters
| Parameter | Type |
|---|---|
client | Client |
data | { } |
Returns
User
Overrides
Properties
avatar?
optionalavatar?:Attachment|null
badges?
optionalbadges?:number
bot
bot:
false|BotInformation
cachedAt
cachedAt:
number
Inherited from
client
protectedreadonlyclient:Client
Inherited from
createdAt
createdAt:
Date
createdTimestamp
createdTimestamp:
number
discriminator
discriminator:
string
displayName?
optionaldisplayName?:string|null
flags?
optionalflags?:number
id
readonlyid:string
Inherited from
online
online:
boolean
privileged?
optionalprivileged?:boolean
pronouns?
optionalpronouns?:string|null=null
relationship
relationship:
UserRelationShip
status?
optionalstatus?: { } |null
username
username:
string
Accessors
tag
Get Signature
get tag():
string
Convenience getter to return the user's tag (username#discriminator)
Returns
string
Methods
_clone()
_clone():
this
Helper to quickly clone a structure
Returns
this
Inherited from
_patch()
_patch(
data,clear?):void
Parameters
| Parameter | Type |
|---|---|
data | { } |
clear? | ("Avatar" | "StatusText" | "StatusPresence" | "ProfileContent" | "ProfileBackground" | "DisplayName" | "Pronouns" | "Internal")[] |
Returns
void
equals()
equals(
other):boolean
Compares this object with another to see if they represent the same entity.
Parameters
| Parameter | Type |
|---|---|
other | string | Base |
Returns
boolean
Inherited from
fetch()
fetch(
force?):Promise<User>
Fetch a User to update their information
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
force | boolean | false | Skip the cache check and force an API request |
Returns
Promise<User>
The fetched User object
Throws
Error if the user cannot be found or fetched
Example
// Fetch a user
await user.fetch();
toString()
toString():
string
Returns the UUID string when the object is cast to a string.
Returns
string