Represents the logged in client's Discord user.
Extends
UserThe base 10 accent color of the user's banner The user must be force fetched for this property to be present or be updated
Inherited from UserThe user avatar decoration's data
Inherited from UserThe user banner's hash The user must be force fetched for this property to be present or be updated
Inherited from UserThe discriminator of this user
Inherited from User'0'
, or a 4-digit stringified number if they're using the legacy username systemThe global name of this user, or their username if they don't have one
Inherited from UserThe flags for this user
Inherited from UserThe hexadecimal version of the user accent color, with a leading hash The user must be force fetched for this property to be present
Inherited from UserWhether this User is a partial
Inherited from UserWhether the user is an Official Discord System user (part of the urgent message system)
Inherited from UserThe tag of this user This user's username, or their legacy tag (e.g.
Inherited from Userhydrabolt#0001
) if they're using the legacy username systemA link to the user's avatar decoration.
Returns
Name | Type | Optional | Description |
---|---|---|---|
options | BaseImageURLOptions | Yes | None |
A link to the user's avatar.
Returns
Name | Type | Optional | Description |
---|---|---|---|
options | ImageURLOptions | Yes | Options for the image URL |
A link to the user's banner. See for more info
Returns
Name | Type | Optional | Description |
---|---|---|---|
options | ImageURLOptions | Yes | Options for the image URL |
Creates a DM channel between the client and the user.
Name | Type | Optional | Description |
---|---|---|---|
force | boolean | Yes | Whether to skip the cache check and request the API |
Deletes a DM channel (if one exists) between the client and the user. Resolves with the channel if successful.
Inherited from UserA link to the user's avatar if they have one. Otherwise a link to their default avatar will be returned.
Name | Type | Optional | Description |
---|---|---|---|
options | ImageURLOptions | Yes | Options for the image URL |
Edits the logged in client.
Name | Type | Optional | Description |
---|---|---|---|
options | ClientUserEditOptions | No | The options to provide |
Checks if the user is equal to another. It compares id, username, discriminator, avatar, banner, accent color, and bot flags. It is recommended to compare equality by using
user.id === user2.id
unless you want to compare all properties.Name | Type | Optional | Description |
---|---|---|---|
user | User | No | User to compare with |
Fetches this user.
Name | Type | Optional | Description |
---|---|---|---|
force | boolean | Yes | Whether to skip the cache check and request the API |
Sends a message to this user.
Example
Name | Type | Optional | Description |
---|---|---|---|
options | string | MessagePayload | MessageCreateOptions | No | The options to provide |
Sets the activity the client user is playing.
Example
Name | Type | Optional | Description |
---|---|---|---|
options | ActivityOptions | Yes | Options for setting the activity |
Sets/removes the AFK flag for the client user.
Sets the avatar of the logged in client.
Example
Name | Type | Optional | Description |
---|---|---|---|
avatar | BufferResolvable | Base64Resolvable | null | No | The new avatar |
Sets the banner of the logged in client.
Example
Name | Type | Optional | Description |
---|---|---|---|
banner | BufferResolvable | Base64Resolvable | null | No | The new banner |
Sets the full presence of the client user.
Example
Name | Type | Optional | Description |
---|---|---|---|
data | PresenceData | No | Data for the presence |
Sets the status of the client user.
Example
Name | Type | Optional | Description |
---|---|---|---|
status | PresenceStatusData | No | Status to change to |
shardId | number | readonly number[] | Yes | Shard id(s) to have the activity set on |
Sets the username of the logged in client. Changing usernames in Discord is heavily rate limited, with only 2 requests every hour. Use this sparingly!
Example
Name | Type | Optional | Description |
---|---|---|---|
username | string | No | The new username |
When concatenated with a string, this automatically returns the user's mention instead of the User object.
Inherited from User