This commit is contained in:
levina 2021-10-25 15:20:41 +07:00 committed by GitHub
parent e4b88a83ab
commit be6e7ecb9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

19
driver/admins.py Normal file
View File

@ -0,0 +1,19 @@
from typing import List
from pyrogram.types import Chat
from cache.admins import get as gett, set
async def get_administrators(chat: Chat) -> List[int]:
get = gett(chat.id)
if get:
return get
else:
administrators = await chat.get_members(filter="administrators")
to_set = []
for administrator in administrators:
if administrator.can_manage_voice_chats:
to_set.append(administrator.user.id)
set(chat.id, to_set)
return await get_administrators(chat)