Hierarchy

Constructors

  • Parameters

    • client: Client
    • data: {
          _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;
      }
      • _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

    Returns Attachment

Properties

client: Client
deleted: boolean = false

Accessors

  • get metadata(): {
        type: "File";
    } | {
        type: "Text";
    } | {
        height: number;
        type: "Image";
        width: number;
    } | {
        height: number;
        type: "Video";
        width: number;
    } | {
        type: "Audio";
    }
  • Parsed file metadata.

    Returns {
        type: "File";
    } | {
        type: "Text";
    } | {
        height: number;
        type: "Image";
        width: number;
    } | {
        height: number;
        type: "Video";
        width: number;
    } | {
        type: "Audio";
    }

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;
          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;
      }> = {}

    Returns Attachment