Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KlasaUser<T>

Klasa's Extended User

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

  • new KlasaUser(...args: keyof unknown[]): KlasaUser

Properties

avatar

avatar: string | null

The user's avatar hash.

since

0.0.1

see

https://discord.com/developers/docs/reference#image-formatting

bot

bot: boolean

Whether or not the user belongs to an OAuth2 application.

since

0.0.1

Readonly client

client: T

discriminator

discriminator: string

The user's 4-digit discord-tag.

since

0.0.1

Optional email

email: string | null

The user's email.

since

0.0.1

Optional flags

flags: APIUserFlags

The flags on a user's account.

since

0.0.1

see

https://discord.com/developers/docs/resources/user#user-object-user-flags

Readonly id

id: string

The user's ID.

since

0.0.1

lastMessageID

lastMessageID: string | null

The id for the last message recieved for this user

since

0.0.3

Optional locale

locale: undefined | string

The user's chosen language option.

since

0.0.1

Optional mfaEnabled

mfaEnabled: undefined | false | true

Whether or not the user has two factor enabled on their account.

since

0.0.1

Optional premiumType

premiumType: PremiumType

The type of Nitro subscription on a user's account.

since

0.0.1

see

https://discord.com/developers/docs/resources/user#user-object-premium-types

Optional publicFlags

publicFlags: APIUserFlags

The public flags on a user's account.

since

0.0.1

see

https://discord.com/developers/docs/resources/user#user-object-user-flags

settings

settings: Settings

The user level settings for this context (user || default)

since

0.5.0

Optional system

system: undefined | false | true

Whether or not the user is an Official Discord System user (part of the urgent message system).

since

0.0.1

username

username: string

The user's username, not unique across the platform.

since

0.0.1

Optional verified

verified: undefined | false | true

Whether or not the email on this account has been verified.

since

0.0.1

Accessors

channel

  • get channel(): DMChannel | null
  • Gets an existing DMChannel from the cache.

    since

    0.0.1

    Returns DMChannel | null

createdAt

  • get createdAt(): Date
  • The Date when this object was created at

    Returns Date

createdTimestamp

  • get createdTimestamp(): number
  • The time when this object was created at

    Returns number

defaultAvatarURL

  • get defaultAvatarURL(): string | null
  • Returns the default discord avatar url for the user's discriminator.

    Returns string | null

tag

  • get tag(): string
  • Returns the users username and discriminator.

    since

    0.0.1

    Returns string

Methods

Protected _patch

  • _patch(data: APIUserData): this
  • Parameters

    • data: APIUserData

    Returns this

avatarURL

  • avatarURL(options?: ImageURLOptions): string | null
  • Returns the users avatar url.

    Parameters

    • Optional options: ImageURLOptions

      The image size, format and other options.

    Returns string | null

clone

  • clone(): this
  • Basic clone method

    Returns this

closeDM

  • closeDM(): Promise<DMChannel | null>

displayAvatarURL

  • displayAvatarURL(options?: ImageURLOptions): string | null
  • Returns the users avatar url or the default discord avatar url if they don't have a avatar.

    Parameters

    • Optional options: ImageURLOptions

      The image size, format and other options.

    Returns string | null

openDM

  • openDM(): Promise<DMChannel>

toJSON

  • toJSON(): Record<string, any>

toString

  • toString(): string
  • Defines toString behavior for members.

    since

    0.0.1

    Returns string

valueOf

  • valueOf(): string
  • The basic value of this Structure

    Returns string

Generated using TypeDoc