Search code examples
pythonpython-3.xtelegramtelethon

Telethon get_dialogs function is taking forever


I'm trying to list all my account channels that i joined via Telethon. However, the await client.get_dialogs() function is taking forever with no response back!

I did even try the followign code as an alternative but the same thing is happening to client.iter_dialogs() function

async for dialog in client.iter_dialogs():
    if dialog.is_channel:
        print(f'{dialog.id}:{dialog.title}')

Any ideas!!


Solution

  • I have faced this problem when I have a huge number of chats in my account. Consequently, the function returned all chats. Maybe you should wait a bit longer.