Class File

Uploaded File

Hierarchy

  • File

Constructors

  • Construct File

    Parameters

    • client: Client

      Client

    • file: Pick<{
          _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;
      }, "_id" | "tag" | "metadata"> & Partial<{
          _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

    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