acb73101c0
- Consolidated and simplified code formatting by removing unnecessary line breaks and improving readability in various functions. - Updated the handling of backup file sending in backup.py for better clarity. - Streamlined error handling and logging messages in several handlers to enhance consistency. - Adjusted the Makefile to exclude specific files during Ruff checks and formatting. - Made minor adjustments to function signatures and parameter handling for improved clarity and consistency. This commit enhances code maintainability and readability without altering functionality.
15 lines
408 B
Python
15 lines
408 B
Python
from aiogram.filters import BaseFilter
|
|
from aiogram.types import Message
|
|
|
|
from config import ADMIN_ID
|
|
|
|
|
|
class IsAdminFilter(BaseFilter):
|
|
async def __call__(self, message: Message) -> bool:
|
|
try:
|
|
admin_ids: int | list[int] = ADMIN_ID
|
|
if isinstance(admin_ids, list):
|
|
return message.from_user.id in admin_ids
|
|
except Exception:
|
|
return False
|