telethon makes him interval for each request

Viewed 6

I have a piece of code like this

    hanzi = "一丁七万丈三上下不与"
    try:
        all_participants = await client.get_participants(my_channel, None,search=hanzi, aggressive=True)
    except errors.FloodWaitError as e:
        print('Have to sleep', e.seconds, 'seconds')
        print("")
        exit
    # except errors.common.MultiError:
    #     print("")
    #     exit

When searching for "hanzi" with too much text, he will prompt a flood error. What I can think of is to split with an array and loop the request, but that doesn't solve the actual problem. Is there a way to make each request delay a few seconds before proceeding.

0 Answers
Related