PagerMaid-Pyro/pyromod/methods/get_dialogs_list.py

14 lines
292 B
Python
Raw Normal View History

2023-01-31 16:24:56 +00:00
from datetime import timedelta
from pyrogram import Client
from pagermaid.common.cache import cache
@cache(ttl=timedelta(hours=1))
async def get_dialogs_list(client: Client):
dialogs = []
async for dialog in client.get_dialogs():
dialogs.append(dialog)
return dialogs