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's hash
Inherited from UserThe user avatar decoration's hash
Inherited from UserThe user banner's hash The user must be force fetched for this property to be present or be updated
Inherited from UserWhether or not the user is a bot
Inherited from UserThe time the user was created at
Inherited from UserThe timestamp the user was created at
Inherited from UserA link to the user's default avatar
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 global name of 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 systemThe username of the user
Inherited from UserA link to the user's avatar decoration.
Returns
Name | Type | Optional | Description |
---|---|---|---|
options | BaseImageURLOptions | Yes | Options for the image URL |
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 banner 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 |
Fetches this user's flags.
Name | Type | Optional | Description |
---|---|---|---|
force | boolean | Yes | Whether to skip the cache check and request the API |
Sets the activity the client user is playing.
Name | Type | Optional | Description |
---|---|---|---|
options | ActivityOptions | Yes | Options for setting the activity |
Sets/removes the AFK flag for the client user.
Name | Type | Optional | Description |
---|---|---|---|
afk | boolean | Yes | Whether or not the user is AFK |
shardId | number | number[] | Yes | Shard Id(s) to have the AFK flag set on |
Sets the avatar of the logged in client.
Name | Type | Optional | Description |
---|---|---|---|
avatar | BufferResolvable | Base64Resolvable | null | No | The new avatar |
Sets the full presence of the client user.
Name | Type | Optional | Description |
---|---|---|---|
data | PresenceData | No | Data for the presence |
Sets the status of the client user.
Name | Type | Optional | Description |
---|---|---|---|
status | PresenceStatusData | No | Status to change to |
shardId | number | 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!
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