From 9688d7e2c59bbe9bf87ec53dd61b1eb810b0e904 Mon Sep 17 00:00:00 2001 From: illvart Date: Sun, 24 Mar 2024 18:55:49 +0700 Subject: [PATCH] update --- getter/core/functions.py | 8 ++------ requirements-dev.txt | 4 ++-- requirements.txt | 6 +++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/getter/core/functions.py b/getter/core/functions.py index f0a9e32..252c086 100644 --- a/getter/core/functions.py +++ b/getter/core/functions.py @@ -204,9 +204,7 @@ async def is_admin( ) -> bool: try: prm = await message.client.get_permissions(chat_id, user_id) - if prm.is_admin: - return True - return False + return bool(prm.is_admin) except BaseException: return False @@ -225,9 +223,7 @@ async def admin_check( return False if not prm.is_admin: return False - if require and not getattr(prm, require, False): - return False - return True + return not (require and not getattr(prm, require, False)) def to_privilege(privilege: str) -> str: diff --git a/requirements-dev.txt b/requirements-dev.txt index 344e99b..118e66e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,3 @@ -ruff==0.3.1 -black==24.2.0 +ruff==0.3.4 +black==24.3.0 isort==5.13.2 diff --git a/requirements.txt b/requirements.txt index cccb2be..a137e0d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ cryptg==0.4.0 psutil==5.9.8 heroku3==5.2.1 GitPython==3.1.42 -SQLAlchemy==2.0.28 +SQLAlchemy==2.0.29 asyncpg==0.29.0 aiosqlite==0.20.0 sqlalchemy-json==0.7.0 @@ -15,11 +15,11 @@ aiofiles==23.2.1 aiocsv==1.3.1 aiohttp[speedups]==3.9.3 httpx==0.27.0 -Markdown==3.5.2 +Markdown==3.6 beautifulsoup4==4.12.3 emoji==2.10.1 Unidecode==1.3.8 -validators==0.22.0 +validators==0.24.0 telegraph==2.2.0 requests==2.31.0 lottie==0.7.0