cache admin

This commit is contained in:
yasirarism 2023-06-26 14:56:09 +00:00 committed by GitHub
parent ee27bcd992
commit 8f12521220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
from functools import partial, wraps
from time import time
from traceback import format_exc as err
from cachetools import TTLCache
from typing import Optional, Union
from pyrogram import Client, enums
@ -86,7 +87,7 @@ async def check_perms(
return False
admins_in_chat = {}
admins_in_chat = TTLCache(maxsize=1000, ttl=6*60*60)
async def list_admins(chat_id: int):