- uploadMedia(client, media, params?): Promise<Extract<MessageMedia, Photo | RawDocument>>
Parameters
- client: ITelegramClient
- media: InputMediaLike
- params: {
peer?: InputPeerLike;
progressCallback?: ((uploaded: number, total: number) => void);
} = {}Optional
progressCallback?: ((uploaded: number, total: number) => void)
- (uploaded, total): void
Parameters
- uploaded: number
- total: number
Returns void
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.