Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
742 B
2
Indexable
Never
                    async for dialog in client.iter_dialogs():

                       try:

                           if not dialog.entity.username and not dialog.name:
                               print(dialog.entity.id)
                               await client(LeaveChannelRequest(dialog.entity.id))

                           elif not dialog.entity.username:

                               await client(LeaveChannelRequest(dialog.name))

                           else:

                               await client(LeaveChannelRequest(dialog.entity.username))


                       except Exception as ex:
                           print(ex)
                           continue
                       await asyncio.sleep(0.8)