'Limits to Telegram API get_entity requests

my app listen requests with telegram messages URL inside and process messages in loop: get entity for group search +/- 2 messages from target message get entity for each recieved message author (in fact find entity to each uniqual from_id)

I use client.get_messages() and client.get_entity() methods ans sleep 10-15 secs between each loop.

And after 2-3 hours without any alerts (floodwait to 10sec or 5 minuts) I getting floodwait error with insane timeout (~22 hours). I not trying to send spam, in fact I don`t sent any messages at all .

Where I can find limits to use get_entity methods? Or may be using this method is overkill and user info may be finded someother method



Solution 1:[1]

I suggest you to take a look at the Telethon documentation: in there there are a few tips that let you avoid the limits using get_entity combined with get_input_entity.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TheKill-996