User

User

Represents a user

Constructor

new User()

Properties:
Name Type Attributes Description
accentColor Number <nullable>

The user's banner color, or null if no banner color (REST only)

avatar String <nullable>

The hash of the user's avatar, or null if no avatar

avatarDecorationData Object <nullable>

The data of the user's avatar decoration, including the asset and sku ID, or null if no avatar decoration

avatarDecorationURL String <nullable>

The URL of the user's avatar decoration

avatarURL String

The URL of the user's avatar which can be either a JPG or GIF

banner String <nullable>

The hash of the user's banner, or null if no banner (REST only)

bannerURL String <nullable>

The URL of the user's banner

bot Boolean

Whether the user is an OAuth bot or not

createdAt Number

Timestamp of the user's creation

defaultAvatar String

The hash for the default avatar of a user if there is no avatar set

defaultAvatarURL String

The URL of the user's default avatar

discriminator String

The discriminator of the user. If they've migrated to the new username system, this will be "0"

globalName String <nullable>

The user's display name, if it is set. For bots, this is the application name

id String

The ID of the user

mention String

A string that mentions the user

publicFlags Number <nullable>

Publicly visible flags for this user

staticAvatarURL String

The URL of the user's avatar (always a JPG)

system Boolean

Whether the user is an official Discord system user (e.g. urgent messages)

username String

The username of the user

Source:

Methods

dynamicAvatarURL(formatopt, sizeopt) → {String}

Get the user's avatar with the given format and size

Source:
Parameters:
Name Type Attributes Description
format String <optional>

The filetype of the avatar ("jpg", "jpeg", "png", "gif", or "webp")

size Number <optional>

The size of the avatar (any power of two between 16 and 4096)

Returns:
Type:
String

dynamicBannerURL(formatopt, sizeopt) → (nullable) {String}

Get the user's banner with the given format and size

Source:
Parameters:
Name Type Attributes Description
format String <optional>

The filetype of the banner ("jpg", "jpeg", "png", "gif", or "webp")

size Number <optional>

The size of the banner (any power of two between 16 and 4096)

Returns:
Type:
String

getDMChannel() → {Promise.<DMChannel>}

Get a DM channel with the user, or create one if it does not exist

Source:
Returns:
Type:
Promise.<DMChannel>