Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.start()
- dialogs = []
- async def getArchived():
- limit: int = 0
- offset_date = 0
- offset_id = 0
- offset_peer = pyrogram.raw.types.InputPeerEmpty()
- return await app.invoke(raw.functions.messages.GetDialogs(offset_date=offset_date, offset_id=offset_id, offset_peer=offset_peer, limit=limit, hash=0, folder_id=1), sleep_threshold=60)
- async def main():
- i = 0
- r = await getArchived()
- chats = {i.id: i for i in r.chats}
- users = {i.id: i for i in r.users}
- print("ARCHIVED:")
- for item in r.dialogs:
- try:
- dialog = pyrogram.types.Dialog._parse(app, item, {}, users, chats)
- print(dialog.chat.id, dialog.chat.type.value, item.folder_id)
- dialogs.append(dialog)
- except Exception as e:
- print(type(e).__name__, e)
- print("TOTAL:")
- for dialog in dialogs:
- print(dialog.chat.title or dialog.chat.first_name)
- i += 1
- print(i)
- app.loop.run_until_complete(main())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement