User
- class User()
A Discord account returned in an event payload or REST response. The object is a snapshot. Call User.fetch when current profile data matters.
exported from
lib.weeble.d- Implements:
Properties
- User.accentColor
type: readonly number | null | undefined
The user’s accent color as a 24-bit RGB integer, or
null.
- User.avatar
type: readonly string | null | undefined
Hash of the user’s avatar, or
nullif using the default avatar.
- User.banner
type: readonly string | null | undefined
Hash of the user’s banner, or
nullif no banner is set.
- User.bot
type: readonly boolean | null | undefined
Indicates whether this user is a bot.
undefinedwhen omitted,nullif Discord sent null.
- User.createdAt
type: readonly Date
When this Discord account was created, decoded from the user snowflake.
- User.discriminator
type: readonly string | undefined
The user’s four-digit discriminator (e.g.
"1234"). undefined when omitted; not invented as"0".
- User.displayName
type: readonly string
The name best suited for display in user-facing output. Returns the global display name when set, otherwise the username.
- User.globalName
type: readonly string | null | undefined
The user’s global display name, or
nullif not set.
- User.primaryGuild
type: readonly
UserPrimaryGuild| null | undefinedThe user’s displayed guild identity, or
nullwhen none is selected.
- User.publicFlags
type: readonly number | null | undefined
Public Discord user flags bitfield, or
nullwhen Discord omitted it.
Methods
- User.displayAvatarURL(options: { format?: “png” | “jpg” | “webp” | “gif”; size?: number; }) string
Get the CDN URL for the user’s avatar.
- Parameters:
options — – Optional size and image format for the avatar.
- Returns:
The CDN URL string.
-
async User.fetch() Promise<
User> Refetch the latest user data from Discord.
- Returns:
The updated user object.