Class ClientUser

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
  • Parameters

    Returns Promise<null | ClientUser | ResponseFromApi>

    Example

    client.edit({
    username: "DBDTeamJS",
    avatar: `https://cdn.discordapp.com/icons/759558437088264202/a_a54e72d76462c99427db0287b7312d02.png`
    }).then((result) => {
    if(result.error){console.log(result)}
    console.log(`Changed avatar + username successfully!`)
    })
  • Parameters

    • url: string

      The new username of the Client

    Returns Promise<null | ClientUser | ResponseFromApi>

    Example

    const link = `https://cdn.discordapp.com/icons/759558437088264202/a_a54e72d76462c99427db0287b7312d02.png`
    client.editAvatar(link).then((result) => {
    if(result.error){console.log(result)}
    console.log(`Changed avatar successfully!`)
    })

Generated using TypeDoc