Hierarchy

Constructors

  • Parameters

    • client: Client
    • data: {
          _id: string;
          avatar?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          badges?: number;
          bot?: {
              owner: string;
          };
          discriminator: string;
          display_name?: string;
          flags?: number;
          online?: boolean;
          privileged?: boolean;
          profile?: {
              background?: {
                  _id: string;
                  content_type: string;
                  deleted?: boolean;
                  filename: string;
                  message_id?: string;
                  metadata: {
                      type: "File";
                  } | {
                      type: "Text";
                  } | {
                      height: number;
                      type: "Image";
                      width: number;
                  } | {
                      height: number;
                      type: "Video";
                      width: number;
                  } | {
                      type: "Audio";
                  };
                  object_id?: string;
                  reported?: boolean;
                  server_id?: string;
                  size: number;
                  tag: string;
                  user_id?: string;
              };
              content?: string;
          };
          relations?: {
              _id: string;
              status: "Blocked" | "Friend" | "Incoming" | "None" | "Outgoing" | "User" | "BlockedOther";
          }[];
          relationship?: "Blocked" | "Friend" | "Incoming" | "None" | "Outgoing" | "User" | "BlockedOther";
          status?: {
              presence?: "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
              text?: string;
          };
          username: string;
      }
      • _id: string

        Description

        Unique Id

      • Optional avatar?: {
            _id: string;
            content_type: string;
            deleted?: boolean;
            filename: string;
            message_id?: string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: string;
            reported?: boolean;
            server_id?: string;
            size: number;
            tag: string;
            user_id?: string;
        }

        Description

        Avatar attachment

        • _id: string

          Description

          Unique Id

        • content_type: string

          Description

          Raw content type of this file

        • Optional deleted?: boolean

          Description

          Whether this file was deleted

        • filename: string

          Description

          Original filename

        • Optional message_id?: string
        • metadata: {
              type: "File";
          } | {
              type: "Text";
          } | {
              height: number;
              type: "Image";
              width: number;
          } | {
              height: number;
              type: "Video";
              width: number;
          } | {
              type: "Audio";
          }

          Description

          Parsed metadata of this file

        • Optional object_id?: string

          Description

          Id of the object this file is associated with

        • Optional reported?: boolean

          Description

          Whether this file was reported

        • Optional server_id?: string
        • size: number

          Format: int

          Description

          Size of this file (in bytes)

        • tag: string

          Description

          Tag / bucket this file was uploaded to

        • Optional user_id?: string
      • Optional badges?: number

        Format: int32

        Description

        Bitfield of user badges

      • Optional bot?: {
            owner: string;
        }

        Description

        Bot information

        • owner: string

          Description

          Id of the owner of this bot

      • discriminator: string

        Description

        Discriminator

      • Optional display_name?: string

        Description

        Display name

      • Optional flags?: number

        Format: int32

        Description

        Enum of user flags

      • Optional online?: boolean

        Description

        Whether this user is currently online

      • Optional privileged?: boolean

        Description

        Whether this user is privileged

      • Optional profile?: {
            background?: {
                _id: string;
                content_type: string;
                deleted?: boolean;
                filename: string;
                message_id?: string;
                metadata: {
                    type: "File";
                } | {
                    type: "Text";
                } | {
                    height: number;
                    type: "Image";
                    width: number;
                } | {
                    height: number;
                    type: "Video";
                    width: number;
                } | {
                    type: "Audio";
                };
                object_id?: string;
                reported?: boolean;
                server_id?: string;
                size: number;
                tag: string;
                user_id?: string;
            };
            content?: string;
        }

        Description

        User's profile page

        • Optional background?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          }

          Description

          Background visible on user's profile

          • _id: string

            Description

            Unique Id

          • content_type: string

            Description

            Raw content type of this file

          • Optional deleted?: boolean

            Description

            Whether this file was deleted

          • filename: string

            Description

            Original filename

          • Optional message_id?: string
          • metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            }

            Description

            Parsed metadata of this file

          • Optional object_id?: string

            Description

            Id of the object this file is associated with

          • Optional reported?: boolean

            Description

            Whether this file was reported

          • Optional server_id?: string
          • size: number

            Format: int

            Description

            Size of this file (in bytes)

          • tag: string

            Description

            Tag / bucket this file was uploaded to

          • Optional user_id?: string
        • Optional content?: string

          Description

          Text content on user's profile

      • Optional relations?: {
            _id: string;
            status: "Blocked" | "Friend" | "Incoming" | "None" | "Outgoing" | "User" | "BlockedOther";
        }[]

        Description

        Relationships with other users

      • Optional relationship?: "Blocked" | "Friend" | "Incoming" | "None" | "Outgoing" | "User" | "BlockedOther"

        Description

        Current session user's relationship with this user

      • Optional status?: {
            presence?: "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
            text?: string;
        }

        Description

        User's current status

        • Optional presence?: "Online" | "Idle" | "Focus" | "Busy" | "Invisible"

          Description

          Current presence option

        • Optional text?: string

          Description

          Custom status text

      • username: string

        Description

        Username

    Returns User

Properties

client: Client
deleted: boolean = false

Accessors

  • get presence(): "Online" | "Idle" | "Focus" | "Busy" | "Invisible"
  • Returns "Online" | "Idle" | "Focus" | "Busy" | "Invisible"

Methods

  • Runs all of the callbacks for this emitter. (meant to run when an update occurs)

    Parameters

    • Optional updated: any[]

      The objects that caused this update.

    Returns void

  • Update this object with new API data.

    Parameters

    • data: Partial<{
          _id: string;
          avatar?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          badges?: number;
          bot?: {
              owner: string;
          };
          discriminator: string;
          display_name?: string;
          flags?: number;
          online?: boolean;
          privileged?: boolean;
          profile?: {
              background?: {
                  _id: string;
                  content_type: string;
                  deleted?: boolean;
                  filename: string;
                  message_id?: string;
                  metadata: {
                      type: "File";
                  } | {
                      type: "Text";
                  } | {
                      height: number;
                      type: "Image";
                      width: number;
                  } | {
                      height: number;
                      type: "Video";
                      width: number;
                  } | {
                      type: "Audio";
                  };
                  object_id?: string;
                  reported?: boolean;
                  server_id?: string;
                  size: number;
                  tag: string;
                  user_id?: string;
              };
              content?: string;
          };
          relations?: {
              _id: string;
              status: "Blocked" | "Friend" | "Incoming" | "None" | "Outgoing" | "User" | "BlockedOther";
          }[];
          relationship?: "Blocked" | "Friend" | "Incoming" | "None" | "Outgoing" | "User" | "BlockedOther";
          status?: {
              presence?: "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
              text?: string;
          };
          username: string;
      }> = {}

    Returns User