• Upload a media to Telegram servers, without actually sending a message anywhere. Useful when File ID is needed.

    The difference with uploadFile is that the returned object will act like a message media and contain fields like File ID.

    Parameters

    • client: ITelegramClient
    • media: InputMediaLike

      Media to upload

    • params: {
          peer?: InputPeerLike;
          progressCallback?: (uploaded: number, total: number) => void;
      } = {}

      Upload parameters

      • Optionalpeer?: InputPeerLike

        Peer to associate this media with.

        self

      • OptionalprogressCallback?: (uploaded: number, total: number) => void

        Upload progress callback

    Returns Promise<Extract<MessageMedia, Photo | RawDocument>>