Class: ClientUser
Represents the authenticated bot's user object.
Extends
Constructors
Constructor
new ClientUser(
client,data):ClientUser
Parameters
| Parameter | Type |
|---|---|
client | Client |
data | { } |
Returns
ClientUser
Overrides
Properties
avatar?
optionalavatar?:Attachment|null
Inherited from
badges?
optionalbadges?:number
Inherited from
bot
bot:
false|BotInformation
Inherited from
cachedAt
cachedAt:
number
Inherited from
client
protectedreadonlyclient:Client
Inherited from
discriminator
discriminator:
string
Inherited from
displayName?
optionaldisplayName?:string|null
Inherited from
flags?
optionalflags?:number
Inherited from
id
readonlyid:string
Inherited from
online
online:
boolean
Inherited from
privileged?
optionalprivileged?:boolean
Inherited from
relationship
relationship:
UserRelationShip
Inherited from
status?
optionalstatus?: { } |null
Inherited from
username
username:
string
Inherited from
Accessors
tag
Get Signature
get tag():
string
Convenience getter to return the user's tag (username#discriminator)
Returns
string
Inherited from
Methods
_clone()
_clone():
this
Helper to quickly clone a structure
Returns
this
Inherited from
_patch()
_patch(
data,clear?):void
Parameters
| Parameter | Type |
|---|---|
data | { } |
clear? | string[] |
Returns
void
Inherited from
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<ClientUser>
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<ClientUser>
The fetched User object
Throws
Error if the user cannot be found or fetched
Example
// Fetch a user
await user.fetch();
Inherited from
toString()
toString():
string
Returns the UUID string when the object is cast to a string.
Returns
string