photos.getUserPhotos

Returns the list of user photos.

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.getUserPhotos({
        userId: new Api.InputUser({...}),
        offset: 2298587,
        maxId: 8768579,
        limit: 2175124,
        }));
    console.log(result); // prints the result
})();

TL schema

Parameters

Name

Type

Description

offset

Number of list elements to be skipped

max_id

If a positive value was transferred, the method will return only photos with IDs less than the set one

limit

Number of list elements to be returned

Result

photos.Photosarrow-up-right

Possible errors

Code

Type

Description

400

MAX_ID_INVALID

The provided max ID is invalid

400

USER_ID_INVALID

The provided user ID is invalid

Can bots use this methd ?

yes

Last updated

Was this helpful?