Class File

Uploaded File

Hierarchy

  • File

Constructors

  • Construct File

    Parameters

    • client: Client

      Client

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

      File

      • _id: string

        Description

        Unique Id

      • content_type: string

        Description

        Raw content type of this file

      • Optional deleted?: null | boolean

        Description

        Whether this file was deleted

      • filename: string

        Description

        Original filename

      • Optional message_id?: null | 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?: null | string

        Description

        Id of the object this file is associated with

      • Optional reported?: null | boolean

        Description

        Whether this file was reported

      • Optional server_id?: null | 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?: null | string

    Returns File

Properties

#client: Client
contentType: string

Raw content type of this file

filename: string

Original filename

id: string

File Id

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

Parsed metadata of the file

size: number

Size of the file (in bytes)

tag: string

File bucket

Accessors

  • get isSpoiler(): boolean
  • Whether this file should have a spoiler

    Returns boolean

Methods

  • Creates a URL to a given file with given options.

    Returns

    Generated URL or nothing

    Parameters

    • Optional options: {
          height?: number;
          max_side?: number;
          size?: number;
          width?: number;
      }

      Optional query parameters to modify object

      • Optional height?: number
      • Optional max_side?: number
      • Optional size?: number
      • Optional width?: number
    • Optional allowAnimation: boolean

      Returns GIF if applicable, no operations occur on image

    Returns undefined | string

Generated using TypeDoc