Results

Namespace

Type

Hierarchy

  • User <-- You are here!

Implements

Index

Properties

Readonly avatar

avatar: string | null

A hash of the user's current avatar.

Note: Use discord.User.getAvatarUrl to retrieve a URL for the avatar.

Readonly bot

bot: boolean

Will be true if the user is a bot user.

Readonly discriminator

discriminator: string

The user's 4-digit user suffix. It appears after the username on a user's profile page and is needed to send friend requests.

Example: Given the user "Somebody#0001", "Somebody" is the username.

Readonly id

The user's unique Discord id. This field never changes.

Readonly publicFlags

publicFlags: number

Bitflags representing the user's flags.

Readonly username

username: string

The user's username. This can be changed by the user at any time.

Example: Given the user "Somebody#0001", "Somebody" is the username.

Methods

getAvatarUrl

  • getAvatarUrl(type?: ImageType): string
  • Used to return a URL to user's avatar image.

    For animated avatars, it will be a GIF. Otherwise, it will return a PNG.

    If a user's avatar hash is null, it returns a URL to the generic logo-style avatar.

    Parameters

    • Optional type: ImageType

      Specifying the type will force the image to be returned as the specified format.

    Returns string

getTag

  • getTag(): string
  • Returns a string containing the username and discriminator.

    For example, Someone#0001

    Returns string

toMention

  • toMention(): string
  • Returns a mention string in the format of <@id> where id is the id of this user.

    Returns string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc