photos.uploadProfilePhoto
Example
const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');
const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});
(async function run() {
const result = await client.invoke(new Api.photos.uploadProfilePhoto({
file: new Api.InputFile({...}),
video: new Api.InputFile({...}),
videoStartTs: 8374801,
}));
console.log(result); // prints the result
})();import {Api, TelegramClient} from 'telegram';
import {StringSession} from 'telegram/sessions';
const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});
(async function run() {
const result: Api.photos.Photo = await client.invoke(new Api.photos.uploadProfilePhoto({
file: new Api.InputFile({...}),
video: new Api.InputFile({...}),
videoStartTs: 8374801,
}));
console.log(result); // prints the result
})();TL schema
photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
---functions---
photos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;Parameters
Result
Possible errors
Can bots use this methd ?
yes
Related pages
Last updated