Update main.py
Browse files
main.py
CHANGED
@@ -4,6 +4,7 @@ from contextlib import asynccontextmanager
|
|
4 |
from akenoai import AkenoXToJs as js
|
5 |
from akenoai.runner import run_fast
|
6 |
from config import API_ID, API_HASH, BOT_TOKEN, SESSION
|
|
|
7 |
|
8 |
logger = logging.getLogger(__name__)
|
9 |
LOGS = logging.getLogger("[akenox]")
|
@@ -76,6 +77,17 @@ async def get_user_story(link: str = None):
|
|
76 |
"caption": None
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
@fast_app.get("/user/raw/getchat")
|
80 |
async def get_chat_raw(username: str = None):
|
81 |
try:
|
|
|
4 |
from akenoai import AkenoXToJs as js
|
5 |
from akenoai.runner import run_fast
|
6 |
from config import API_ID, API_HASH, BOT_TOKEN, SESSION
|
7 |
+
from pyrogram.enums import ChatMembersFilter
|
8 |
|
9 |
logger = logging.getLogger(__name__)
|
10 |
LOGS = logging.getLogger("[akenox]")
|
|
|
77 |
"caption": None
|
78 |
}
|
79 |
|
80 |
+
|
81 |
+
@fast_app.get("/user/author/admin")
|
82 |
+
async def get_author_admin(username: str = None):
|
83 |
+
same_user = {}
|
84 |
+
async for m in user_client.get_chat_members(username, filter=ChatMembersFilter.ADMINISTRATORS):
|
85 |
+
if not m.user.is_bot and not m.user.is_deleted:
|
86 |
+
same_user[m.user.id] = m.user.first_name
|
87 |
+
return {
|
88 |
+
"admin_list": same_user
|
89 |
+
}
|
90 |
+
|
91 |
@fast_app.get("/user/raw/getchat")
|
92 |
async def get_chat_raw(username: str = None):
|
93 |
try:
|