Represents a User

Hierarchy (view full)

Constructors

Properties

accentColor?: string

The User accentColor

avatar?: string

The User avatar hash

avatarDecoration?: string

The User avatar decoration hash

banner?: string

The User banner hash

bot: boolean

If the user is a bot

client: Client
data: unknown
discriminator?: string

The User discriminator (if has)

displayAvatarUrl: ((opts) => any)

Display's the User avatar URL.

Type declaration

    • (opts): any
    • Parameters

      • opts: any

      Returns any

displayBannerUrl: ((opts) => any)

Display's the User banner URL.

Type declaration

    • (opts): any
    • Parameters

      • opts: any

      Returns any

displayDefaultAvatarUrl: (() => any)

Display's the User default avatar URL.

Type declaration

    • (): any
    • Returns any

flags: number

The user flags

globalName: string

The User global name

id: string

The User ID

system: boolean

If the user is the system

username: string

The User name

Accessors

Methods

  • Returns the User avatar URL

    Parameters

    • Optional opts: CDNOptions

      The CDN Options

    Returns undefined | string

    Example

    const user = client.users.cache.get("738824089128665118")

    user.avatarUrl({
    size: 64,
    format: "jpg"
    })// https://cdn.discordapp.com//avatars/738824089128665118/f67c14413c916648f2fb50be239adf5f.jpg?size=64
  • Returns the User banner URL

    Parameters

    • opts: CDNOptions

      The CDN Options

    Returns undefined | string

    Example

    const user = client.users.cache.get("640685917467705344")

    user.bannerUrl() // https://cdn.discordapp.com/banners/640685917467705344/0510a7bd372082644a05c92ffbbe7b2b.webp
  • Returns the User default avatar URL

    Returns undefined | string

    Example

    const user = client.users.cache.get("738824089128665118")

    user.defaultAvatarUrl()// https://cdn.discordapp.com/embed/avatars/0.png

Generated using TypeDoc