PagerMaid-Pyro/pyromod/methods/get_dialogs_list.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
292 B
Python
Raw Permalink 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