K
K
KirSupi2021-12-05 16:34:30
Python
KirSupi, 2021-12-05 16:34:30

How to get data from the desired Telegram server in Pyrogram?

I use Pyrogram to work with a user account. The user has a private channel from which statistics must be taken.

peer = await app.resolve_peer(channel_id)
if isinstance(peer, pyrogram.raw.types.InputPeerChannel):
    r = await app.send(
        pyrogram.raw.functions.stats.GetBroadcastStats(channel=peer),
        retries=1,
        timeout=10,
        sleep_threshold=0.1
    )
    print(r)

This code throws an error:
pyrogram.errors.exceptions.see_other_303.StatsMigrate: [303 STATS_MIGRATE_X]: The statistics of the group/channel are stored in DC2 (caused by "stats.GetBroadcastStats")

From it you can guess that you need to take data from another dc. Question: how to take data from the desired dc?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question