# PATH: bot/core/auth.py from hydrogram.types import Message from bot.config import Telegram from bot.integrations.cf_worker2 import is_allowed def is_owner_id(uid: int | None) -> bool: return bool(uid and uid == Telegram.OWNER_ID) async def require_allowed(uid: int) -> bool: # owner always allowed if is_owner_id(uid): return True return await is_allowed(uid)