User

User

Represents a Discord user.

Constructor

new User(client, data, optionsnullable)

Description:
  • Creates a structure for a user.

Source:
See:
Parameters:
Name Type Attributes Description
client Client

The client instance.

data Object

The raw user data.

options Object <nullable>

Additional options for this structure.

Properties
Name Type Attributes Description
nocache Boolean <nullable>

Whether the user should be cached or not.

Members

(readonly) _cached :Number

Description:
  • The UNIX (seconds) timestamp when this user was last cached.

Source:

The UNIX (seconds) timestamp when this user was last cached.

Type:
  • Number

(readonly) avatarIsAnimated :Boolean

Description:
  • Whether the user has an animated avatar or not.

Source:

Whether the user has an animated avatar or not.

Type:
  • Boolean

(readonly) bot :Boolean

Description:
  • Whether the user is a bot or not.

Source:

Whether the user is a bot or not.

Type:
  • Boolean

(readonly) createdTimestamp :Number

Description:
  • The UNIX (seconds) timestamp of when this user created their Discord account.

Source:

The UNIX (seconds) timestamp of when this user created their Discord account.

Type:
  • Number

(readonly, nullable) discriminator :String

Description:
  • The discriminator of the user.

Source:

The discriminator of the user.

Type:
  • String

(readonly) displayAvatarURL :String

Description:
  • The avatar URL of the user.

Source:

The avatar URL of the user.

Type:
  • String

(readonly) globalName :String

Description:
  • The global name of the user.

Source:

The global name of the user.

Type:
  • String

(readonly) id :String

Description:
  • The ID of the user.

Source:

The ID of the user.

Type:
  • String

(readonly) mention :String

Description:
  • The mention string for the user.

Source:

The mention string for the user.

Type:
  • String

(readonly) tag :String

Description:
  • The username of the user, including their discriminator if they are a bot (username#0001).

Source:

The username of the user, including their discriminator if they are a bot (username#0001).

Type:
  • String

(readonly) username :String

Description:
  • The username of the user.

Source:

The username of the user.

Type:
  • String

Methods

(static) getAvatarUrl(id, hashnullable) → {String}

Description:
  • Returns the URL to the user's avatar.

Source:
Parameters:
Name Type Attributes Description
id String

The ID of the user to get the avatar for.

hash String <nullable>

The hash of the avatar.

Returns:
Type
String

(static) getMention(id) → {String}

Description:
  • Returns a mention string for the user.

Source:
Parameters:
Name Type Description
id String

The ID of the user to mention.

Returns:
Type
String

(static) shouldCache(gluonCacheOptions, guildCacheOptions) → {Boolean}

Description:
  • Determines whether the user should be cached.

Source:
Parameters:
Name Type Description
gluonCacheOptions GluonCacheOptions

The cache options for the client.

guildCacheOptions GuildCacheOptions

The cache options for the guild.

Returns:
Type
Boolean

overrideAvatarURL(url) → {void}

Description:
  • Overrides the user's avatar with a custom URL.

Source:
Parameters:
Name Type Description
url String

The URL of the avatar to override the user's avatar with.

Returns:
Type
void

toJSON(format) → {Object}

Description:
  • Returns the JSON representation of this structure.

Source:
Parameters:
Name Type Description
format Number

The format to return the data in.

Returns:
Type
Object

toString()

Source: